Ping all the hosts in /etc/hosts

Did you know you can ping all the hosts listed in the /etc/hosts file with one command? Do it with for i in `grep -v “^#” /etc/hosts | awk ‘{print $1}’`; do ping -c 1 -w 2 $i ; echo; done

Multicolumn output with ls

If you do a ls > file.txt, the output will contain a single column of text. If you want to use multiple columns, do a ls -C > file.txt