University of Minnesota Morris Computing Services
 

 
UMM Home > Computing Services > Guides > Unix Commands

Unix Commands

Note:For<x> notation, type a specific x there instead
(i.e.when you see <file>, type a file name there instead). 

Click on a Section Name to jump to that section

Frequently Asked Questions
File Commands
Directories
Other File Commands
Other Misc Commands
Hints

Frequently Asked Questions (FAQ)

How do I change my password?
How can I see who else is logged on?
How do I edit a file?
How do I check my disk space?
How do I print from Unix?

File Commands

list of files
ls, ls -alF
list contents of
more <file>, less <file> (q to quit), cat <file> 
edit/create new
pico <file> (ctrl-x to exit), vi <file> (:wq or ZZ to exit)
copy
cp <old> <new>
move/rename
mv <old> <new>
delete
rm <file>
print
lpr -P<printer_name> <file>
(no space in between the P and the printer name)
 

Directories

 
return to home
cd
show current directory
pwd
change directory
cd <directory> (cd .. just to back up one)
make new directory
mkdir <directory>
delete directory
rmdir <directory>
show disk space used
du (in Kbytes)
 

Other File Commands

 
space used
quota
show print jobs
lpq -P<printer name>
set access privleges on file
chmod <#> <file> (#:700 protects, 777 unprotects)
count lines, words, chars in file
wc <file>
search for word in file
grep <word> <file>
sort lines of file 
sort <file>
compare two files
cmp <file1> <file2>
show file type
file <file>
find a file
find <file>
give first few lines of a file
head <file>
transfer over network
ftp <hostname>
append file
cat <file1> <file2> <new file>
horizontally append
paste <file1> file2> <new file>
 

Other Miscellaneous Commands

 
mail
pine
getting started hints
help
online command help
man <command>
be notified if mail arrives
biff <yes/no>
who you are
whoami
who else is logged in 
who, finger, users, w
show time / date
date
What commands do
whatis <command>, apropos <command>
generate a calendar
cal [month] <year>
clear screen
clear
calculator
dc
echo text to screen
echo <text>
log into another computer
telnet <hostname>, rlogin <hostname>
log typed stuff to file
script <file> (type exit to end script command)
change password
passwd
give a command a nickname
alias <nickname> <command>
logout
exit
 

Hints

  • Ctrl-D will exit you from a program or log you out (you might need to hit it twice)
  • <command> > <file>redirects output of a command to a file - example: finger > myfile
  • <command> >> <file> appends output of a command to a file - example: date >> datefile
  • | takes output from left side as input for right side - example: cat myfile | more
  • -<option> can be used immediately after most commands - example: ls -l
  • apropos 1 for list of commands (~15% are commonly used), then man <command> for options and documentation
  • A file called .login contains a list of commands that run every time you log into your Unix account.
  • A person's root directory is ~username.  Example: cd ~myusername would return control to your root directory