Linux Commands

Table of Contents

HELP

“help”

The Linux command console contains various methods to help you when you are stuck trying to figure out a command or an argument. For example, if there is command you are trying to figure out and cannot seem to remember it, you can simply type “help”. This will bring up a populated list of commands and some of their arguments. If you wish to see more arguments for a command, simply type ” –help” after the command for a list of arguments and their effects on the command. For example, if we wanted to see a list of arguments for the “ls” command, we would type “ls –help”. This will display a list of all the arguments for “ls” and their effect on the command.

help

“man”

The “man” command can be used to obtain detailed information about a command or to view a list of all of the commands and descriptions that contain the word you specify. To get detailed information about a command; type “man [command]”, where command is a command, like “ls”.

man

To view a list of all of the commands and descriptions that contain a specified word; type “man –k [word]”, where [word] is a word like “finger”.

man

COMMUNICATION

CommandAction
digQuery DNS Server
ftpTransfer files across a remote network site
loginLogin to a system
rsyncTransfer files, particularly across a network
scpSecurely copy files to a remote system using ssh
sftpInteractive file transfer program which uses ssh for security
sshLogin to a remote system securely and run commands on that system

COMPARISONS

CommandAction
cmpCompare two files, byte by byte
commCompare lines in two sorted files
diffCompare two text files, line by line
diff3 Compare three files, line by line
sdiffCompare and interactively merge two files

FILE MANAGEMENT

CommandAction
catConcatenate files or display them
chattrChange attributes on an ext2 file
chgrpChange group of files
chmodChange access modes on files
chownChange ownership of files
chshChange login shell
cpCopy files
csplitSplit a file into pieces with a specfic size or at specific locations
ddCopy files in raw disk form
fileDetermine’s a files type
headShow the first few lines of a file
hexdumpDisplay files in hexadecimal format
lessDisplay files by screenful, forward and backward
lnCreate file name aliases
lsLists files and directories
md5sumCompute MD5 checksum
mergeMerge changes from different files
mkdirCreate a directory
moreDisplay files by screenful, forward only
mvMove or rename files and directories
newgrpChange current group
odDisplay files in octal form
pwdPrint working directory
rmRemove files
rmdirRemove directories
sha1sumCompute the SHA1 checksum
shredSecurely delete files
splitSplit files evenly
tacPrint lines of a file in reverse order
tailShow the last few lines of a file
tailf Follow the growth of a logfile
touchUpdate the timestamps and create the file if it doesn’t exist
wcCount lines, words, and characters

MEDIA

CommandAction
cdparanoiaRip a CD while providing extra features
cdrdaoCopy a CD
ejectEject a removable disk or tape
genisoimageGenerate a binary image froma directory tree
icedaxRip a CD or DVD to create a computer-friendly WAV format
readomRead or write data to a CD or DVD
volnameProvide the volume name of a CD-ROM
wodimRecord to a CD or DVD

PRINTING

CommandAction
lpqShow status of print jobs
lprSend to the printer
lprmRemove print job
lpstatGet printer status
prFormat and paginate for printing

PROGRAMMING

CommandAction
arCreate and update library files
asGenerate object file
bisonGenerate parsing tables
cppPreprocess C code
flexLexical analyzer
g++GNU C++ compiler
gccGNU C compiler
ldLink editor
lddPrint shared library dependencies
m4Macro processor
makeCreate programs
ranlibRegenerate archive symbol table
rpcgenTranslate RPC to C code
yaccGenerate parsing tables

SEARCHING

CommandAction
aproposSearch manpages for the topic
egrepExtended version of grep
fgrepSearch files for literal words
findSearch the system for files by name and take a range of possible actions
grepSearch files for text patterns
locateSearch a preexisting
lookSearch file for string at the beginning of lines
stringsSearch binary files for text patterns
updatedbUpdate the locate database
whereisFind command
whichPrint pathname of a command

SHELL PROGRAMMING

CommandAction
basenameRemove leading directory components from a path
echoRepeat command-line arguments on the output
envsubstSubstitute the value of environment variables into strings
exprPerform arithmetic and comparisons
mktempGenerate temporary filename and create the file
printfFormat and print command-line arguments
sleepPause during processing
testTest a condition

SYSTEM STATUS

CommandAction
atExecute commands later
atqShow jobs queued by at
atrmRemove jobs queued by at
crontabHave commands or scripts set to run on a scheduled basis
dateDisplay or set date
dfShow free disk space
duShow disk usage
envShow environment variables
fingerDisplay information about users
freeShow free and used memory
hostnameDisplay information about users
killTerminate a running command
printenvShow environment variables
psShow processes
quotaDisplay disk usage and limits
statDisplay file of filesystem status
sttySet or display terminal settings
topDisplay tasks currently running
ttyDisplay filename of the terminal connected to standard input
unameDisplay system information
vmstatShow virtual memory statistics
whoShow who is logged in

TEXT PROCESSING

CommandAction
colProcess control characters
cutSelect columns for display
emacsWork environment with powerful text-editing capabilities
exLine editor underlying vi
expandConvert tabs to spaces
fmtProduce roughly uniform line lengths
foldBreak lines
gawkProcess lines or records one by one
groffFormat troff input
gsDisplay PostScript or PDF file
ispellInteractively check spelling
joinMerge different columns into a databse
pasteMerge columns or switch order
revPrint lines in reverse
sedNoninteractive text editor
sortSort or merge files
trTranslate (redefine) characters
unexpandConvert spaces to tabs
uniqFind repeated or unique lines in a file
viVisual text editor
vimEnhanced version of vi

MISCELLANEOUS

CommandAction
bcArbitrary precision calculator
calDisplay calendar
clearClear the screen
infoGet command information from the GNU hypertext reader
manGet information on a command
niceReduce a job’s priority 
nohupLaunch a command that will continue to run after logging out
openvtRun a program on the next available virtual terminal
passwrdSet your login password
scriptProduce a transcript of your login session
suBecome a different user, often the superuser
sudoExecute an authorized command as root or another user
teeSimultaneously store output in file and send to screen
timeTime the execution of a command
wallSend a message to all terminals
whoamiPrint the current user id
xargsProcess many arguments in manageable portions