Wednesday, March 9, 2011

Useful Linux commands

Descriptive processes list:
ps -aef -o pcpu= -o pid= -o time= -o vsz= -o user= -o args=

Ping broadcast:

ping -b [a].[b].[c].255

nmap -sP 192.168.0.0/24 or nmap -sP 198.162.0.*

arp list
arp -a

tcp dump:
sudo tcpdump -i en0

Linux version:
uname -a or cat /proc/version

Software RAID:
cat /proc/mdstat

CPU Information:
less /proc/cpuinfo

copy file without rsync scp or ftp
netcat listen on port 1212 (> 1024 if not root) waiting for files
nc -l 1212 | gunzip -c | tar xvfp -
send files from source
tar cfp - /home/myuser/mydir | gzip -c | nc -w 10 destination_ip 1212

Linux Performance Monitoring: htop, dstat, bmon, iftop, ifstat, sysstat
http://server.dzone.com/articles/6-command-line-tools-linux

List open files and associated by process IDs
lsof -p 6714 | grep REG

Subscribe