2007-May-4 - Most frequently used commands on linux platforms.
I'm testing a software on linux platform. Here are the commands that I use most:
/etc/init.d/XXX stop (or start) -- Stop (or start) service XXX. For example, /etc/init.d/postfix stop. On Redhat, the command can also be "service XXX stop (or start)".
df -- Check disk space.
du -abc -- Check the disk space occupation of the current directory.
find ./ -name "XXX" -- Find the file which filename contains string XXX in current folder. Wildcard is supported.
ifconfig -- Check the IP address of the system.
ipcs -- Check the shared memory allocated on a system.
netstat -nat -- Check TCP ports.
nslookup -- Check DNS.
PATH="{directory}":$PATH -- Add {directory} to the front of PATH environment variable. eg. PATH="`pwd`/bin":$PATH.
ps -ef | grep XXX -- Check the processes with the string XXX in name. Some more parameters give more details, eg. "ps aufxw | grep XXX", showing CPU time, and memory.
route -- Check the routes.
route add default gw {gateway ip} -- Add default gateway.
strings XXX | grep SSS -- Search string SSS in file XXX.
top -p {PID} [-p {PID}] -- Monitor the process with {PID}
vi (or vim) -- Enter edit mode of a text file.
zip -P {password} created_file_name {file name} -- Add password to a compressed file.
|