A GUIDE TO UNIX COMMANDS

The general format for a UNIX command is command option(s) filename(s)

Commands are in lower case. File names are not limited to 8 characters in the prefix and 3 in the extension. Use the following UNIX commands from a UNIX shell by typing after the prompt the following.

cat files

displays a file

cat > file

create file. Enter text followed by Ctrl Dto end

cat file 1 >> file 2

append file 1 to end of file 2

cd

changes to home directory

cd ..

change to directory above current directory

cd pathname

changes working directory to pathname

cp old new

copy old file to new file

jot files

text editor for files

lp

send files to file; see instructions on

login

for printing to different printers.

Ls

list names of files in working directory

ls - l

list files names in long form (-l is a modifier)

A typical output from this command is shown below:

total 15 drwxr-xr-x 2 john doc 512 Jul 10 22:25 -rw-r--r-- 1 john doc 136 Jul 8 14:46 .exrc

where the first symbol in the line (d or -) shows whether the "file" is a directory (d) or a plain file (-), and the next letters specify 3 groups (yourself, your group, and all others who are allowed to read (r), write (w) and execute (x) your files; john shows the owner who created or owns the file; doc is the group that owns the file; the last set of characters is the name of the file or directory.

man command

display manual page of command

mkdir pathname

create a new directory with pathname

more files' display one screenful of each file at a time

 

mv old new

move or rename old file to new file

passwd

change password

pwd

print working (current) directory name

rm files

remove (delete) files

rmdir pathname

remove empty directory with pathname

vi file

the standard UNIX file editor

whoami

if you don't know how do you expect thecomputer to know?

Ctrl C

will get you out of any program

Ctrl D

will get you out of a UNIX shell

 Special symbols:

/ separator used in pathnames

* match any number of characters in a filename

? match any single character in a filename

Moving and renaming files is accomplished most readily by clicking you file folder on your desktop. You can transfer files by moving the icons representing the files from one window to another. Change files name by clicking on the filename and editing it.