Usefull linux tools

From vpsget wiki
Jump to: navigation, search

please note: for installing some toosl you ned to connect EPEL repo ( first.

htop  -extened version of top (process list, memory use ,etc..)
atop - Advanced top. The most powerfull monitoring tool (CPU, IO, MEM, SWP, Commited, Network, Caches, etc)
iotop - Show top I/O disk usage processes.
dnstop - show dns connections . Example using from CT:  dnstop -4 venet0
stress - H/W stress test [Example:  stress --cpu 8 --io 16 --vm 32 --vm-bytes 256M --timeout 100000000s]
vmstat - system activity, hardware and system information
ps - displays the processes (ps aux for e.g)
free - memory usage
iostat - average CPU load, disk activity
mpstat - multiprocessor usage
pmap - process memory usage
netstat and ss - network statistics. Example: netstat -anpu|wc -l ; netstat -tulpn
iftop - showing n/w interfaces traffic usage
iptraf - real-time network statistics
tcpdump - detailed network traffic analysis. Example:  tcpdump -vvvnn #show maximally verbosed 
strace - system calls. Example ps auxw | grep httpd | awk '{print"-p " $2}' | xargs strace   (stracing apache)
cpuburn - cpu stress test 
dd if=/dev/zero of=/dev/null - load 1 CPU core

Use next to make more CPU cores load:

fulload() { dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null | dd if=/dev/zero of=/dev/null & }; fulload; read; killall dd
df -h   - show hdd usage statistics
lsof - list open files, network connections and much more. Example: lsof -i:80 - show pids that using port 80.
nmap - scan specified host for open ports.
vnstat - vnStat is a console-based network traffic monitor
scp - copying data from one linux host to another using ssh
mtr - combines the functionality of the traceroute and ping programs in a single network diagnostic tool. Example: mtr --report --report-cycles 200
smartctl  - show/test smart on the specified  HDD (Examples: smartctl -a  /dev/sda; smartctl -a  /dev/sda; smartctl -H  /dev/sda. Test : smartctl --test=short /dev/sda;  smartctl --test=long /dev/sda) 
smartctl and megaraid - use smartctl with megaraid tool will show the SMART status for HDDs in RAID. [Example: smartctl -a -d megaraid,5 /dev/sda]
w  -will show logged users (tty)
rsync - not just copy like scp. it's syncing live. Example: rsync -avzH --numeric-ids -e 'ssh -p6622' /vz/template/cache/centos-6-x86-freepbx.tar.gz 
uname -a - show linux version with kernel details
cat /etc/issue - will show the linux distro
whoami - use this command after the gr8 party:)
pkill -KILL -u {username} - log out user
fg -foreground
bg - background. Example of usage. If some process exited with STOP you can forcely continue it with next command: fg $1  # $1-contain last PID
host - shpow host info for ip. Example: host -t TXT . Example2: host (you will see the rDNS for ip if it exists)

dig - domain info. Example1: dig .Example2: dig+trace (usefull when you waiting for propagation). Example3: dig in ns - you will get the NS servers for domain.
whois - you need to know whois is some ip or domain? use whois! Ex: whois Ex2: whois

Delete All files older than 3 days in specified folder:
find /path/to/files* -mtime +3 -exec rm {} \;