Recently I’ve encounter list of IPs that are related to CoinHive. So I want to check for these IPs DNS. We can do that by using dig command to perform reverse DNS (rDNS).
Reverse DNS (rDNS) is a method of resolving an IP address into a domain name, just as the domain name system (DNS) resolves domain names into associated IP addresses.
I found this script at this site:
domain=$(dig -x "$item" +short)
if [ -n "$domain" ] ;
echo "$item" - "$domain"
echo "$item" result is NULL
Just save this code above in your Linux/*nix machine, and run this command as below:
[email protected]:~# cat ip.txt | xargs bash reverse_dns
The result should be like this:
Lets say you have this kind of file/folder structure:
master ---- folder1 --- image1.jpg
| -- image2.jpg
-- folder2 --- image1.jpg
| -- image2.jpg
You can take all the *.jpg file or any file type, and move it into one folder.
Here are the command to use:
cd <root_directory> <-- "where all the file are located"
find * -type f -print0 | xargs -0 -I%%% mv -n %%% ../<new_directory> <-- "new destination folder"
The error when executing the bash code:
install.sh: Syntax error: "(" unexpected
The script does not begin with a shebang line, so the kernel executes it with /bin/sh. On Ubuntu, /bin/sh is dash, a shell designed for fast startup and execution with only standard features. When dash reaches the line, it sees a syntax error: that parenthesis doesn’t mean anything to it in context.
Since dash (like all other shells) is an interpreter, it won’t complain until the execution reaches the problematic line. So even if the script successfully started at some point in your testing, it would have aborted once the problematic line was reached.
The shebang line must be the very first thing in the file. Since you use bash features, the first line of the file must be #!/bin/bash or #!/usr/bin/env bash.