Wednesday, May 12, 2010

Common Linux commands by category

Help and Abbreviations
Command NameAction
aproposFinds online manual pages for a specified keyword
infoDisplays online help information about a specified command
manDisplays online help information
whatisSimilar to apropos but searches for complete words only
aliasDefines an abbreviation for a long command
typeShows the type and location of a command
unaliasDeletes an abbreviation defined using alias

Managing Files and Directories
Command NameAction
cdChanges the current directory
chmodChanges file permissions
chownChanges file owner and group
cpCopies files
lnCreates symbolic links to files and directories
lsDisplays the contents of a directory
mkdirCreates a directory
mvRenames a file as well as moves a file from one directory to another
rmDeletes files
rmdirDeletes directories
pwdDisplays the current directory
touchUpdates a file's time stamp

Find Files
Command NameAction
findFinds files based on specified criteria,such as name and size
locateFinds files using a periodically updated filename database.(The database is created by the updatedb program.)
whereisFinds files based in the typical directories where executable (also known as binary)files are located
whichFinds files in the directories listed in the PATH enviroment variable

Processing Files
Command NameAction
catDisplays a file on standard output (can be used to concatenate several files into one big file)
cutExtracts specified sections from each line of text in a file
ddCopies blocks of data from one file to another(used to copy data from devices)
diffCompares two text files and finds any differences
expandConverts all tabs into spaces
fileDisplays the type of data in a file
foldWraps each line of text to fit a specified width
grepSearches for regular expressions within a text file
lessDisplays a text file one page at a time(can go backward,also)
lprPrints files
moreDisplays a text file,one page at a time(goes forward only)
nlNumbers all nonblank lines in a text file and prints the lines to standard output
pasteConcatenates corresponding lines from several files
patchUpdates a text file using the differences between the original and revised opy of the file
sedCopies a file to standard output while applying specified editing commands
sortSorts lines in a text file
splitBreaks up a file into several smaller files with specified size
tacReverses a file(last line first and so on)
tailDisplays the last few lines of a file
trSubstitutes one group of characters for another throughout a file
uniqEliminates duplicate lines from a text file
wcCounts the number of lines,words,and characters for another throughout a file
zcatDisplays a compressed file (after decompressing)
zlessDisplays a compressed file one page at a time(can go backward also)
zmoreDisplays a compressed file one page at a time

Archiving and Compressing Files
Command NameAction
compressCompresses files
cpioCopies files to and from an archive
gunzipDecompresses files compressed with GNU Zip(gzip)
gzipCompresses files using GNU Zip
tarCreates an archive of files in one or more directories(originally meant for archiving on tape
uncompressDecompresses files compressed with compress

Managing System
Command NameAction
bgRuns an interrupted process in the background
fgRuns a process in the foreground
freeDisplays the amount of free and used memory in the system
haltShuts down Linux and halts the computer
killSends a signal to a proces(usually used to terminate a process)
lddDisplays the shared libraries needed to run a program
niceRuns a process with lower priority(referred to as nice mode)
psDisplays a list of currently running processes
printenvDisplays the current enviroment variables
pstreeSimilar to ps bu shows parent-child relationships clearly
rebootStops Linux and then restart the computer
shutdownShuts down Linux
topDisplays a list of most processor-and memory-intensive processes
unameDisplays information about the system and the Linux kernel

Managing Users
Command NameAction
chshChanges the shell(command interpreter)
groupsPrints the list of groups that include a specified user
idDisplays the user and group ID for a specified user name
passwdChanges the password
suStarts a new shell as another user or root(when invoked without any argument)

Managing the File System
Command NameAction
dfSummarizes free and available space in all mounted
duDisplays disk usage information
fdformatFormats a diskette
fdiskPartitions a hard disk
fsckChecks and repairs a file system
mkfsCreates a new file system
mknodCreates a device file
mkswapCreates a swap space for Linux in a file or a hard drive partition
mountMounts a device(for example,the CD-ROM)on a directory in the file system
swapoffDeactivates a swap space
swaponActivates a swap space
syncWrites buffered(saved in memory) date to files
ttyDisplays the device name for the current terminal
unmountUnmounts a device from the file system

Dates and Times
Command NameAction
calDisplays a calendar for a specified month or year
dateShows the current date and time or sets a new date and time

No comments:

Search This Blog