Unix Commands to Know and Use
By Emil on Thursday 8 March 2007, 14:29 - System Administration - Permalink
I will be updating this entry with commands that I have come to use throughout my system administration and engineering work. I hope that it is of some use to readers who stumble on this site.
- Watch for changes in active and inactive connections in the Linux Virtual
Server kernel table
watch -n 5 "ipvsadm -L -n" - List the types and amount of TCP states in the linux networking
subsytem
netstat -tan |awk '{print $6}'|perl -ne 'chomp; $a{$_}++; END { print map({ "$_:$a{$_}\n" } sort keys %a); }' - List the SYN_RECV state per IP address
netstat -tan |grep SYN_RECV |awk -F '[ :][ :]*' '{print $6}' | perl -ne 'chomp; $a{$_}++; END { print map({ "$_: $a{$_}\n" } sort key
s %a); }'
- CHMOD all of the files (not directories) in a directory
find . -type f -exec chmod a+r \{\} \; - CHMOD all of the directories (not files) in a directory
find . -type d -exec chmod a+rx \{\} \; - Find the largest file in the filesystem excluding NFS mounted shares
find / -fstype nfs -o -type f -ls | sort +6n -r | less
- Find the largest files in the filesystem
find / -xdev -type f -ls | sort +6n -r | less - Remove the CVS directories that populate a source directory
find ./ -name CVS -type d -exec rm -fr {} \; -- find ./ -name .cvsignore -exec rm -f {} \;
Comments