Linux Commands

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".

man1

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".

man2

Communication

Command

Action

dig Query DNS Server
ftp Transfer files across a remote network site
login Login to a system
rsync Transfer files, particularly across a network
scp Securely copy files to a remote system using ssh
sftp Interactive file transfer program which uses ssh for security
ssh Login to a remote system securely and run commands on that system
   

Comparisons

Command

Action

cmp Compare two files, byte by byte
comm Compare lines in two sorted files
diff Compare two text files, line by line
diff3  Compare three files, line by line
sdiff Compare and interactively merge two files
   

File Management

Command

Action

cat Concatenate files or display them
chattr Change attributes on an ext2 file
chgrp Change group of files
chmod Change access modes on files
chown Change ownership of files
chsh Change login shell
cp Copy files
csplit Split a file into pieces with a specfic size or at specific locations
dd Copy files in raw disk form
file Determine's a files type
head Show the first few lines of a file
hexdump Display files in hexadecimal format
less Display files by screenful, forward and backward
ln Create file name aliases
ls Lists files and directories
md5sum Compute MD5 checksum
merge Merge changes from different files
mkdir Create a directory
more Display files by screenful, forward only
mv Move or rename files and directories
newgrp Change current group
od Display files in octal form
pwd Print working directory
rm Remove files
rmdir Remove directories
sha1sum Compute the SHA1 checksum
shred Securely delete files
split Split files evenly
tac Print lines of a file in reverse order
tail Show the last few lines of a file
tailf  Follow the growth of a logfile
touch Update the timestamps and create the file if it doesn't exist
wc

Count lines, words, and characters

 

 

Media

Command

Action

cdparanoia Rip a CD while providing extra features
cdrdao Copy a CD
eject Eject a removable disk or tape
genisoimage Generate a binary image froma directory tree
icedax Rip a CD or DVD to create a computer-friendly WAV format
readom Read or write data to a CD or DVD
volname Provide the volume name of a CD-ROM
wodim Record to a CD or DVD
   

Printing

Command

Action

lpq Show status of print jobs
lpr Send to the printer
lprm Remove print job
lpstat Get printer status
pr Format and paginate for printing
   

Programming

Command
Action
ar Create and update library files
as Generate object file
bison Generate parsing tables
cpp Preprocess C code
flex Lexical analyzer
g++ GNU C++ compiler
gcc GNU C compiler
ld Link editor
ldd Print shared library dependencies
m4 Macro processor
make Create programs
ranlib Regenerate archive symbol table
rpcgen Translate RPC to C code
yacc Generate parsing tables
   

Searching

Command

Action

apropos Search manpages for the topic
egrep Extended version of grep
fgrep Search files for literal words
find Search the system for files by name and take a range of possible actions
grep Search files for text patterns
locate Search a preexisting
look Search file for string at the beginning of lines
strings Search binary files for text patterns
updatedb Update the locate database
whereis Find command
which Print pathname of a command
   

Shell Programming

Command

Action

basename Remove leading directory components from a path
echo Repeat command-line arguments on the output
envsubst Substitute the value of environment variables into strings
expr Perform arithmetic and comparisons
mktemp Generate temporary filename and create the file
printf Format and print command-line arguments
sleep Pause during processing
test Test a condition
   

System Status

Command

Action

at Execute commands later
atq Show jobs queued by at
atrm Remove jobs queued by at
crontab Have commands or scripts set to run on a scheduled basis
date Display or set date
df Show free disk space
du Show disk usage
env Show environment variables
finger Display information about users
free Show free and used memory
hostname Display information about users
kill Terminate a running command
printenv Show environment variables
ps Show processes
quota Display disk usage and limits
stat Display file of filesystem status
stty Set or display terminal settings
top Display tasks currently running
tty Display filename of the terminal connected to standard input
uname Display system information
vmstat Show virtual memory statistics
who Show who is logged in
   

Text Processing

Command

Action

col Process control characters
cut Select columns for display
emacs Work environment with powerful text-editing capabilities
ex Line editor underlying vi
expand Convert tabs to spaces
fmt Produce roughly uniform line lengths
fold Break lines
gawk Process lines or records one by one
groff Format troff input
gs Display PostScript or PDF file
ispell Interactively check spelling
join Merge different columns into a databse
paste Merge columns or switch order
rev Print lines in reverse
sed Noninteractive text editor
sort Sort or merge files
tr Translate (redefine) characters
unexpand Convert spaces to tabs
uniq Find repeated or unique lines in a file
vi Visual text editor
vim Enhanced version of vi
   

Miscellaneous

Command

Action

bc Arbitrary precision calculator
cal Display calendar
clear Clear the screen
info Get command information from the GNU hypertext reader
man Get information on a command
nice Reduce a job's priority 
nohup Launch a command that will continue to run after logging out
openvt Run a program on the next available virtual terminal
passwrd Set your login password
script Produce a transcript of your login session
su Become a different user, often the superuser
sudo Execute an authorized command as root or another user
tee Simultaneously store output in file and send to screen
time Time the execution of a command
wall Send a message to all terminals
whoami Print the current user id
xargs Process many arguments in manageable portions