Saturday, September 6, 2008

General Linux Common Command

Generic Linux

COMMAND NAME		DESCRIPTION
df -h shows disk usage in human readable form
man <commandname> shows more info about a command
uname -a kernel release version
/usr/sbin/smbd -V samba version
/usr/sbin/httpd -v apache version
mysql -v mysql version
php -v php version
mv moves or renames a file
cp copies or backsup a file
rm removes or deletes a file
ps -ax|grep <process> outputs processes running <process>
ps -AH report process status
top shows processes
top -i shows only active processes
iptraf shows network info
mc -d show midnight commander to navigate through system easily
cat /proc/mdstat shows software raid
host -t mx aol.com shows the mx records for aol.com
net groupmap list shows samba mappings to nt groups
telinit 1 changes to single user mode
ifconfig shows detailed info on ethernet ports
grep -r "casesensitivesearch" * finds all documents containing the criteria in a dir
tail -f /var/log/<LOGFILE> realtime viewing of your log file
hdparm -t /dev/mdx (where x is 0,1,2,etc) shows software raid performance
mdadm --detail /dev/mdx (where x is 0,1,2,etc) gives raid info
tar -czvf foo.tar.gz foo creates a tar/zip file of a directory
tar -xvzf foo.tar.gz untar/unzip a tar/zip file
scp -P <ssh_portnumber> foo.tar.gz <other_server_ipaddress>:/opt transfers file to another server
rsync --progress -te "ssh -p <ssh_portnumber>" foo <other_server_ipaddress>:/opt transfers file to another server
sed -i s/foo/fee/g <FILENAMEORPATHTODIR> replaces foo with fee

No comments: