McMaster University

Search

Explore

Print this page

NOTE: All commands listed here must be entered in lower case as UNIX is a case sensitive operating system.

Topic
If You want To 
Type This Command
DIRECTORIES find out which directory are you currently in? pwd
move from the current directory to the system root directory cd /
move to a different directory cd  directory_name
make a sub-directory in your current directory  mkdir  new_directory_name
remove an empty sub-directory from the current directory rmdir  directory_name
remove a directory, all sub-directories and all the files contained within them (USE WITH CAUTION !) rm  -r  directory_name
move up one directory level cd ..
move up two directory levels cd ../..
move to an adjacent directory cd ../directory_name
return to your login (or home) directory cd  $home
FILES delete a file rm  filename

in response to filename? type y

list files contained in your home directory ls
list all files, including hidden ones (such as a .forward or a .signature file) ls  -a
list the contents of a text file (one page at a time) more  filename (text will only display one screen at a time, press the spacebar to see the next page)
list the contents of a text file (without control over screen scrolling) cat  filename
list details of a file including permissions  ls  -l (file permissions [d = directory, r = read, w = write, x = executable], links present for a directory, logonid, size, date, time/year, filename)
list details of a file (as above) plus any hidden files  ls  -la
rename a file mv  oldfile newfile
move a file mv  file.ext subdir/file.ext
locate a file of your own, display its path or alias which  filename (shows an alias if applicable or the location of the file if it is located in a directory found in the current path) [first found instance of filename]
locate a file (system or your own), and display its path find  path -name  file -print (searches for all instances of the file as named, starting at the location specified in path, working its way down the directories until all the subdirectories have been searched)
locate a file on the path from the current directory, and display its location whereis  filename (searches for filename, a system executable file, beginning in the current directory and its subdirectories)
HELP use the on-line help manual man  command (eg: man ls displays pages for the list command)
on using the online help manual man  man
displays commands containing a keyword man  -k  keyword (eg: man -k quota displays all commands with the keyword QUOTA)
LOCATING A PERSON'S LOGIN ID a system id for a particular person(s) with a common name whois  surname
a system id for a particular person finger  surname
list all people currently logged in finger

 

 

 
Contact Us | Legal & Privacy Policy