A Basic Guide to UNIX Commands


UNIX is case senstitive:  cd  ≠  CD



$ - represents the unix prompt in the working (current) directory


  This is a screen shot of a sample unix command prompt. 

                                                                               In the table below italics represent file names and bolds represent directory names
Command
Function
Example
Directory level
cd
Changes to a sub-directory
$ cd stuff
                         
Takes you to the home directory $ cd
mkdir
Makes new directory
$ mkdir stuff
rmdir
Removes the directory
$ rmdir stuff
ls -l
Lists all files and directories with read write and executer privileges
$ ls -l
pwd
Shows the working (current) directory you are in
$ pwd
~
Represents home directory


Takes you to the home directory
$ cd ~
..
Represents the directory located one level above


Opens directory above
$ cd ..
.
Represents the directory that you are currently in

/
Represents the directory one level below


Opens a directory one level below
$ cd ./stuff



File level
ls
Displays files and subdirectories in the working (current) directory
$ ls
cp
Copies a file to the new name you give it
$ cp file1 file2
rm
Deletes a file
$ rm file1
mv
Moves files to the specified directory
$ mv file stuff
find
Finds a file location
$ find ./ -name file1
more
Displays a file's contents, one screen at a time
(use Spacebar to display next page;
use Enter to display next line)
$ more file1
cat
Displays a file's entire contents
$ cat file1
vi
Edits a file
$ vi file1
*
Wildcard, when searching for a file, a * at the end of a
letter searches for all files with that beginning
$ find ./ -name f*



Network
mail
Dispalys mail
$ mail
write
Sends a message to a user's screen
$ write smithj hi
finger
Displays information on a user
$ finger smithj
logout
Quits terminal and logs out
$ logout
yppasswd
Changes your password
$ passwd
who
Displays current sessions (users)
$ who
whoami
Displays your user name
$ whoami



Miscellaneous
man, info
Displays manual (help) pages for a command
$ man mv

will display help pages for the mv command
date
Displays the date and time
$ date
quota -v
Displays disk space available and used
$ quota -v
                                                                                                                 


This web page was created by Ryan Pifer.
email: piferr at ncssm.edu