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) changes the current working directory
cd directory change to the named directory
cd change to home-directory
cd .. change to parent directory(move up 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 names it file2
cp file1 your_directory makes a copy of file1 in your_directory
cp file1 your_directory/file2 makes a copy of file1 in your_directory and names it file2
more file displays the contents of file on the screen one page at a time.
  • press space-bar to see the next page
  • press q to quit reading
  • press return to see the next line
lpr -Pcs4204 file1 file2 ..... prints files to EE/CS 4-204 printers
  • Note that you should buy printer cards from the operators at EE/CS 4-204 -
    they are $1 or $4, checks only, no cash or credit cards!
  • To print 2 pages in one page do enscript -2Gr -Pcs4204 your_file
    OR mpage -Pcs4204 -2 your_file
  • To print 4 pages in one page do mpage -Pcs4204 -4 your_file

Other useful commands

man command Read on-line manuals on command
for example, typing man lpr gives an on-line manual page for lpr
netscape & Start a netscape web browser to surf the net
pine Read/write email
elm 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


Sunny Kim (kimx0320@itlabs.umn.edu)

The views and opinions expressed in this page are strictly those of the page author.
The contents of this page have not been reviewed or approved by the University of Minnesota.