Check These Out
for me the above command didn't work for more than one argument but this one does
It takes over 5 seconds to scan a single port on a single host using nmap
$ time (nmap -p 80 192.168.1.1 &> /dev/null)
real 0m5.109s
user 0m0.102s
sys 0m0.004s
It took netcat about 2.5 minutes to scan port 80 on the class C
$ time (for NUM in {1..255} ; do nc -w 1 -z -v 192.168.1.${NUM} 80 ; done &> /dev/null)
real 2m28.651s
user 0m0.136s
sys 0m0.341s
Using parallel, I am able to scan port 80 on the entire class C in under 2 seconds
$ time (seq 1 255 | parallel -j255 'nc -w 1 -z -v 192.168.1.{} 80' &> /dev/null)
real 0m1.957s
user 0m0.457s
sys 0m0.994s
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"
In case you're like me and like your commands to start on clean lines, especially when you're deep into a 10-level directory tree. This can be added to .bashrc.
This is assuming that you're editing some file that has not been wrapped at 80 columns, and you want it to be wrapped. While in Vim, enter ex mode, and set the textwidth to 80 columns:
$ :set textwidth=80
Then, press:
$ gg
to get to the top of the file, and:
$ gqG
to wrap every line from the top to the bottom of the file at 80 characters.
Of course, this will lose any indentation blocks you've setup if typing up some source code, or doing type setting. You can make modifications to this command as needed, as 'gq' is the formatting command you want, then you could send the formatting to a specific line in the file, rather than to the end of the file.
$ gq49G
Will apply the format from your current cursor location to the 49th row. And so on.
Like 7172, but much easier.
Handy when you need to create a list of files to be updated when subversion is not available on the remote host. You can take this tar file, and upload and extract it where you need it. Replace M and N with the revisions specific to yours. Make sure you do this from an updated (svn up) working directory.
This is a 'nocd' alternative :)