Few great UNIX commands & useful links
Following are the some advanced UNIX commands which i found very useful.
Other Links:
http://members.unine.ch/philippe.renard/unix2.html
http://www.indiastudychannel.com/resources/121854-Advanced-Unix-Commands.aspx
| DNS (Domain Name Service) | |
| host string | Perform forward or reverse lookup on string |
| dig @nameserver string | Lookup string's host info from nameserver |
| System Hardware Information | |
| grep -i memtotal /proc/meminfo | Find total amount of RAM in the system |
| dmidecode -q | Display DMI/SMBIOS information |
| cat /proc/cpuinfo | Display CPU information |
| egrep '(vmx|svm)' /proc/cpuinfo | See if a processor supports hardware virtualization |
| lspci -tv | Display PCI information |
| lsusb -tv | Display USB information |
| hdparm -i /dev/sda | Display disk information for sda |
| Quick HTML Editing Site Wide | |
| find . -type f -print -exec sed -i -e 's|X|Y|g' {} \; | Replace all X's with Y's in all files this directory and below. |
| perl -pi -w -e 's/X/Y/g;' *.txt | Replace all X's with Y's in all files ending with *.txt |
| find -name '*' | xargs grep 'string' | Print filename and all lines containing 'string' |
| SSH (Secure Shell) | |
| scp -p -r [USER]@[HOST]:file /dir | Recursively copy while preserving permissions |
| ssh-copy-id [USER]@[HOST] | Install public key for trusted login on HOST |
| Troubleshooting | |
| ps -auxf | Full process list with Child Process Tree |
| netstat -tup | List all active network connections and state |
| lsof -i :80 | Show information related to http (port 80) connections |
| lsof -u userid | List open files by a particular userid |
| iftop | List active network connections consuming bandwidth |
| iptraf | Monitor IP Traffic |
| htop | Like top, but with an h |
| mtr | My Traceroute - An improved traceroute |
| multitail | Tail mutiple files at the same time |
| siege | A http/web stress test utility |
| Samba / Windows File Sharing | |
| smbtree | Scan local network for windows shares |
| Isolate DoS (Denial of Service) Attacks with netstat | |
| netstat -an | grep :80 | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | |
| netstat -anp | grep 'tcp\|udp' | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | |
| netstat -ntu | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | |
| netstat -ntu | grep -v TIME_WAIT | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr | |
| Bit Torrent Clients | |
| rtorrent | Bit Torrent Client |
| aria2 | Bit Torrent Client |
http://members.unine.ch/philippe.renard/unix2.html
http://www.indiastudychannel.com/resources/121854-Advanced-Unix-Commands.aspx
Comments