Linux Command Cheat Sheet
Command Description Usage/Example
pwd Print the full path to the pwd
directory you are in
cd change directory Full path:
cd /home/students/user/wx272
Relative path:
cd ../wx272
ls List the contents of a Print all contents of present directory:
directory (or specify a ls
pattern to match)
Print all contents of present directory that start
with ‘gfs’ and end with ‘.nc’:
ls gfs*.nc
ll List the contents of a Print all contents of present directory:
directory (or specify a ll
pattern to match) with
additional information Print all contents of present directory that start
(permissions, file size, with ‘nam’ and end with ‘.grib2’:
date file modified) ll nam*.grib2
ls –ld Print ownership and Print the ownership and permissions for your
permissions information home directory:
about a directory ls –ld /home/students/username
file Print the file type Print the file type of image.gif:
file image.gif
cp Copy a file Copy file1.txt as file2.txt:
cp file1.txt file2.txt
mv Move or rename a file Rename file1.txt to file2.txt:
mv file1.txt file2.txt
Move file1.txt from the home directory to the
wx272 directory:
mv ~/file1.txt ~/wx272/
cat Print all the contents of a Print all the contents of file1.txt to the terminal:
file to the terminal cat file1.txt
more Print the contents of a Print the contents of file1.txt to the terminal:
file to the terminal one more file1.txt
page at a time
man Print more information Print the manual page for the command ls:
about a command man ls