UNIX on your ITLabs account


Listing files and directories

ls lists the files and directories in the current working directory
Directories

mkdir (make directory)            creates a directory
rmdir (remove directory)          removes an empty directory
pwd (print working directory)   find the current directory
cd (change directory)                 creates a directory

Files

mv file1 file2               moves (or renames) file1 to file2
rm file1 file2 file3 ..... removes (or deletes) files named file1 file2 file3 ...
cat file                          displays the contents of file on the screen all at once.
emacs file1 &              starts emacs editor to edit file1

cp file1 file2 makes a copy of file1 in the current working directory and calls it file2
more file displays the contents of file on the screen one page at a time.
lpr -Pcs4204 file1 file2 ..... prints files to EE/CS 4-204 printers

Other useful commands

man command Read on-line manuals on command for example, typing man lpr gives an on-line manual page for lpr

mozilla & Start a mozilla web browser to surf the net

pine Read/write email

quota -v Check how much space you have left on your account


Emacs (key stroke commands follow in ( ))

Change directory(cd) to the directory where you want to edit your files.
Type emacs & at the Unix prompt.
  1. To create a new file, go to the File menu and select Open File (C-x C-f) and type the filename you want.
  2. To open an already existing file, do the same as the above except use the name of the file you want to open.
  3. To save a file, go to File menu and select Save Buffer (C-x C-s)
  4. To save a file as a different file, go to File menu and Save Buffer As (C-x C-w)
  5. To close a file, select Kill Buffer (C-x k) from the File menu.
  6. To quit Emacs, select Exit Emacs (C-x C-c) from the File menu.

Copy and Paste

To copy text, hold down the left mouse button and select the desired text.
To paste, position your mouse at the desired place and press the middle mouse button.
Example
When you first log in...

kimx0320@ .... % ls
Mail/          News/

kimx0320@ .... % ls -a
./             ../             Mail/            News/

kimx0320@ .... % ls -l
total 2
drwx------   2 kimx0320 student       512 Mar  9  1998 Mail/
drwx------   2 kimx0320 student       512 Mar  9  1998 News/

kimx0320@ .... % ls -al
total 4
drwx------   3 kimx0320 student       512 Mar 15  1999 ./
drwx------  27 kimx0320 student       512 Sep 13 17:14 ../
drwx------   2 kimx0320 student       512 Mar  9  1998 Mail/
drwx------   2 kimx0320 student       512 Mar  9  1998 News/

To create a directory for csci 1901 course
kimx0320@ .... % mkdir csci1901

To see the directory you have just created
kimx0320@ .... % ls
Mail/          News/           csci1901/

To remove the directory you have just created
kimx0320@ .... % rmdir csci1901

To see if removing worked
kimx0320@ .... % ls
Mail/          News/ 

To re-create a directory for csci 1901 course
kimx0320@ .... % mkdir csci1901

To see the directory you have just created
kimx0320@ .... % ls
Mail/          News/           csci1901/

To change to the directory csci1901
kimx0320@ .... % cd csci1901
Mail/          News/           csci1901/

To find out where you are
kimx0320@ .... % pwd
/home/it19/kimx0320/csci1901

To create a directory for your homework #0
kimx0320@ .... % mkdir lab0
kimx0320@ .... % ls
lab0/

kimx0320@ .... % cd lab0
kimx0320@ .... % pwd
/home/it19/kimx0320/csci1901/lab0

Written by Sunny Kim for the Csci 1901 students