Saturday, July 10, 2010

Most Commonly Used Linux Commands



Host Information

uname .............. Print system information
hostname ........... Print the system's hostname
ifconfig ........... Display or set network interface configuration
host ............... Lookup DNS information
nslookup ........... Lookup DNS information (deprecated)
whois .............. Lookup domain registrants
ping ............... Test reachability of a host
traceroute ......... Display network path to a host

Process Management

ps ................. List processes
w .................. List users' processes
uptime ............. View the system load, amount of time it has been running, etc.
top ................ Monitor processes
free ............... Display free memory
kill ............... Send signals to processes
killall ............ Kill processes by name
nice ............... Set a processes nice value
renice ............. Set the nice value of a running process.
at ................. Run a job at a specific time
crontab ............ Schedule repeated jobs
batch .............. Run a job as the system load premits
watch .............. Run a programm at specific intervals
sleep .............. Wait for a specified interval of time

Disks and File Systems

df ................ Display free space
du ................ Display disk usage
mount ............. Mount a filesystem
fsck .............. Check and repair a filesystem
sync .............. Flush disk caches

File and Directory Basics

cd ................. Change Directory
cp ................. Copy files
file ............... Determine a file's content
ls ................. List files or directories
ln ................. Make a link to a file
mkdir .............. Make a directory
rmdir .............. Remove a directory
mv ................. Move a file
rm ................. Remove a file

Locate Files

find .............. Find files and directories
which ............. Locate commands within your search path
whereis ........... Locate standard file

File Management

ls ................ Display file attributes
stat .............. Display file attributes
wc ................ Count the number of lines, words and characters in a file
file .............. Identify file types
touch ............. Set the time stamp of a file or directory
chgrp ............. Change the group of a file
chmod ............. Change the permissions (mode) of a file
chown ............. Change the owner of a file
chattr ............ Change advanced file attributes
lsattr ............ Display advanced file attributes

File Viewing

cat ............... Display the contents of file
less .............. Page through files
head .............. Show the top portion of a file
more .............. Display screenfuls of a file
tail .............. Display bottom portion of a file
nl ................ Count the number of lines in a file
wc ................ Count the number of lines, words and characters in a file
od ................ View a binary file
tee ............... Display output on stdout and write it to a file simultaneously

File Manipulation

csplit ............ Split a file
cut ............... Display columns of a file
paste ............. Append columns in a file
sort .............. Sort a file
tr ................ Translate chracters in a file
uniq .............. Find unique or repeated lines in a file
xargs ............. Process multiple arguements

File Comparison

diff .............. Find differences in two files
dircmp ............ Compare two directories
cmp ............... Compare two files
comm .............. Compare sorted files
md5sum ............ Compute the MD5 checksum of a file
sum ............... Compute the checksum of a file

File Compression and Archiving

gzip .............. Compress a file using GNU Zip
gunzip ............ Uncompress a file using GNU Zip
compress .......... Compress a file using UNIX compress
uncompress ........ uncompress a file using UNIX compress
bzip2 ............. Compress a file using block-sorting file compressor
bunzip2 ........... Uncompress a file using block-sorting file compressor
zip ............... Compress a file using Windows/DOS zip
unzip ............. Uncompress a file using Windows/DOS zip
tar ............... Read/Write (tape) archives
cpio .............. Copy files to and from archives
dump .............. Dump a disk to tape
restore ........... Restore a dump
mt ................ Tape control programme

Printing

lpr ............... Print files
lpq ............... View the print queue
lprm .............. Remove print jobs
lpc ............... Line printer control program


No comments:

Post a Comment