Quick Unix Tutorial

Examples of Basic Commands

 Action 
 Command 
 Examples 
appent to file cat >> cat >> file1
combine 2 files cat cat file1 file2 > file3
copy files cp cp myfile copymyfile
create a file cat cat > newfile
edit files vi vi file
list files ls ls bin/
move a file mv mv file1 doc/chapter1
remove a file rm rm unwantedfile
rename a file mv mv oldfilename newfilename
view files cat
pg
more
less
view
cat file
pg file2 file3
view file6 file7
 Directories 
 Command 
 Examples 
change to another directory cd cd example/first/
create a directory mkdir mkdir example1
find out where you are pwd pwd
go to your home directory cd cd
remove an emplty eirectory rmdir rmdir junk

Redirection of Output or Input
>
   redirects the output of a command to a file
>>  redircts the output of a command to the end of an existing file
<    takes the input of a command form a file, not the terminal

Summary of Basic Commands