Difference between revisions of "Usefull linux tools"

From vpsget wiki
Jump to: navigation, search
Line 17: Line 17:
  
 
  free - memory usage
 
  free - memory usage
 
+
 
 
  iostat - average CPU load, disk activity
 
  iostat - average CPU load, disk activity
  
Line 32: Line 32:
 
  tcpdump - detailed network traffic analysis. Example:  tcpdump -vvvnn #show maximally verbosed  
 
  tcpdump - detailed network traffic analysis. Example:  tcpdump -vvvnn #show maximally verbosed  
  
  strace - system calls
+
  strace - system calls. Example ps auxw | grep httpd | awk '{print"-p " $2}' | xargs strace  (stracing apache)
  
 
  cpuburn - cpu stress test  
 
  cpuburn - cpu stress test  
Line 51: Line 51:
 
  scp - copying data from one linux host to another using ssh
 
  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.
+
  mtr - combines the functionality of the traceroute and ping programs in a single network diagnostic tool. Example: mtr --report --report-cycles 200 domain.com
  
 
  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  - 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)  
Line 58: Line 58:
  
 
  w  -will show logged users (tty)
 
  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
 
  uname -a - show linux version with kernel details
Line 66: Line 68:
  
 
  pkill -KILL -u {username} - log out user
 
  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 78.84.40.188.abuse-contacts.abusix.org . Example2: host 8.8.8.8 (you will see the rDNS for ip if it exists)
 +
 +
dig - domain info. Example1: dig vpsget.com .Example2: dig+trace vpsget.com (usefull when you waiting for propagation). Example3: dig @m.gtld-servers.net in ns vpsget.com - you will get the NS servers for domain.
 +
 
 +
whois - you need to know whois is some ip or domain? use whois! Ex: whois 8.8.8.8. Ex2: whois domain.com
 +
 +
 
  
 
"[[Category:Linux]]"
 
"[[Category:Linux]]"

Revision as of 09:41, 15 April 2015

please note: for installing some toosl you ned to connect EPEL repo ( http://wiki.vpsget.com/index.php/Epel_centos) 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 domain.com
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 78.84.40.188.abuse-contacts.abusix.org . Example2: host 8.8.8.8 (you will see the rDNS for ip if it exists)

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

 

""