A Quick-Reference List of L Commands: Infosheet 9
A Quick-Reference List of L Commands: Infosheet 9
Version 3.4
A quick-reference list of LINUX
commands
Logging in and out
ssh secure remote login to another
computer
sftp securely transfer files to or from
another computer
exit exit from a program or a window, or
logout
Managing your files and directories
ls list the files in a directory
cp copy files
mv move or rename files
rm remove a file or a directory
mkdir make a new directory
cd change to another directory
pwd display the pathname of the current
working directory
find find a file in a directory tree
quota display your disk quota and usage
du display the number of disk blocks
used per directory or file
chmod change the access permissions for a
file or a directory
Looking in files
less browse through a text file
cat concatenate or display a file
head display the first few lines of a file
tail display the last few lines of a file
wc display a count of lines, words and
characters
spell report spelling errors
grep search a file for a particular set of
characters
diff display linebyline differences
between two text files
Electronic mail
pine read and send electronic mail
mailsize display the size of your electronic
mail Inbox
mailname display the mailname of somebody
in Durham
Printing
queryprepaid
display your current number of
printing credits
lp send a job to a printer queue
lpstat display jobs waiting to be printed in a
printer queue
cancel remove job(s) from a printer queue
Text editors
pico simple text editor
emacs powerful text editor
vi LINUX text editor
Compressing and archiving files
gzip compress files
gunzip uncompress files
tar read and write tape or file archives
eject eject floppy disk, CDROM, etc, from
a drive
dos2unix convert text file from DOS format to
UNIX/LINUX format
Managing your processes
ps display the status of current
processes
bg resume running a suspended
process in the background
fg resume running a suspended
process in the foreground
kill terminate a process
history display a list of the most recently
executed commands
script make a transcript of a terminal
session
Getting help
man display the online manual pages, or
find manual pages by keyword
What to do if things go wrong
quit possible exit command
bye possible exit command
exit exit or logout
Ctrl/Q unlock scrolling after locking with
Ctrl/S
Ctrl/C escape from current process
Ctrl/D end input, or exit from process
Ctrl/Z suspend current process
Further commands
Date and time
date display current date and time
time time a command
Manipulating text files
sort sort and collate lines
cut remove selected fields from each
line of a file
paste join corresponding lines from several
files, or sequential lines from one file
split split a file into pieces
comm display lines in common, or lines not
in common, between two sorted lists
uniq remove or report adjacent duplicate
lines
expand convert tab characters to spaces
unexpand convert spaces to tab characters
tr copy a file, substituting or deleting
selected characters
fold fold long lines at a given width
pr prepare files for printing, perhaps in
multiple columns
More about files
file try to determine a files type from its
contents
ln create a link to a file
scp secure remote file copy
umask set the file permissions mask
About the system
who display who is logged on
id display information about your
username
groups list a users group memberships
hostname display the name of the computer
you are using
uname display information about the system
df display the amount of free disk
space
which display the pathname or alias for a
command
Customising your session
alias create an alias for a command or set
of commands
unalias discard an alias
env display your environment variables
setenv set an environment variable
unsetenv discard an environment variable
set display or set shell variables
unset discard a shell variable
To display more details about a command, type
man commandname
9LinuxCommands.doc: September 2007