Unix Reference

Adapted from the reference produced by the Department of Mathematics, Statistics and Computing Science, Dalhousie University, January 1994 v1.1

  1. Change Password
  2. Type passwd, and answer the system prompts for old password, new password, and verification of new password.

  3. Help
  4. Account Information
  5. Files
  6. The characters ? and * are used for pattern matching. A ? matches any single character, and a * matches an arbitrary number of characters.

    Creating

    Removing/Renaming/Moving/Copying

    Listing

  7. Directories
  8. Like filenames, directories use ? and * as pattern matching characters (see Files). The current directory and parent directory, are named . and .. respectively.

    Creating/Traversing

    Removing/Renaming/Moving/Copying

    Listing

  9. I/O Redirection
  10. The standard input/output/error of a command, normally associated with the terminal, may be redirected by appending one the following to the command line:

  11. Editing
    • create/edit file - jove editor: jove filename
    • create/edit file - visual editor: vi filename
    • create/edit file - emacs editor: emacs filename
    • create/edit file - line editor: ex filename

  12. Printing
    • print text file on screen: more filename
    • print text file on screen: less filename
    • print text file on laser printer: lw -Pprintername filename
    • print tex document on laser printer: lw -d -Pprintername filename
    • print postscript document on laser printer: lw -ps -Pprintername filename
    • check laser printer queue: lwq -Pprintername
    • remove printjob from laser print queue: lwrm -Pprintername jobnumber

  13. Formatting Documents
    • format a tex document: tex filename
    • format a latex document: latex filename

    TEX and laTEX files must have .tex as a filename extension. TEX and laTEX produce files with .dvi as a filename extension.
    To view a .dvi file: xdvi filename

  14. Electronic Mail
    • read mail: pine
    • Shortcut: at $prompt, to send mail to a address: pine address
    • Shortcut: at $prompt, to send mail to multiple addresses: pine address1 address2 address3
    • mail a file to some address: mail address < file

  15. News
    • read/post news: tin
    • post news: Pnews

  16. Languages and Compilers
    • compile C lanuage source file: gcc filename
    • compile C++ lanuage source file: g++ filename
    • compile java lanuage source file: javac filename
    • run java file on java virtual machine: java filename
    • compile Fortarn lanuage source file: f77 filename
    • compile Pascal lanuage source file: pc filename
    • run Common Lisp interpreter: cl
    • Awk pattern scanning and processing language: gawk -f programfile

    C, Fortran, Java and Pascal source files must have the extensions .c, .f, .java and .p respectively.

  17. Commands
    • calulator: bc
    • monthly calendar: cal month year
    • yearly calendar: cal year
    • current date and time: date
    • show differences between two files: diff file1 file2
    • display information about a user: finger username
    • file transfers to/from a remote host: ftp hostname
    • find lines matching a specific string: grep string file(s)
    • find lines not matching a specific string: grep -v string file(s)
    • show the first num lines of filename: head -num filename
    • view online manual pages: man command
    • login to a remote unix host: rlogin hostname
    • execute a command on a remote unix host: rsh host command
    • spelling checker: spell filename
    • show the last num lines of filename: tail -num filename
    • talk to another user: talk username
    • connect to a remote host: telnet hostname
    • display information on the top CPU processes: top
    • show how long the system has been up: uptime
    • display number of lines, words, and character in a file: wc filename
    • show who is on the system: who