Basic Linux and DrScheme quick reference

Text in brackets < > is a parameter and is not meant to be typed literally.

  1. Make sure you're using a Linux lab machine and not a Windows machine.

  2. Logging out: use the start menu in the bottom left corner.

  3. Directory browsing: Click the folder icon in the top left.

  4. Terminal usage: Right click on the desktop gives you a menu. Choose terminal.

  5. Running a program from the terminal: type <program name>&

    e.g. drscheme&

    & causes the preceding command to fork off the terminal; if you don't type it then the terminal will be monopolized by the program.

  6. Changing your password:

    In the terminal type passwd and follow the directions.

  7. Web browsing: run firefox&. The course site is http://www.cs.caltech.edu/courses/cs1

  8. Submitting labs and homework: cs1man submit <file name>

  9. To copy and paste: Selecting text copies it. Clicking the middle button pastes.

File and directory navigation and manipulation in the terminal (shell) language:

  1. pwd outputs your current location

  2. cd <dir> changes your location to the directory specified by <dir>.

    eg. cd / will move you to the root directory,

    and cd ~ will move you to your home directory.

  3. A directory or file can be specified either absolutely or relatively:

    absolutely: specify the location from the root of the directory tree

      eg. /usr/bin/ is the directoy bin in usr located at the top level of the tree

    relatively: specify the location from your current location:

      ../ specifies one level up

      <name> specifies a directory or file at this level.

      eg. from /usr/bin use ../../lib to specify /lib

      and from / use lib to specify /lib.

  1. mv <file or dir> <dir2> moves a file or a directory into directory dir2.

  2. mv <file or dir> <dir2>/<name> if <dir2>/<name> doesn't already exist then <file or dir> gets renamed to <name> and moved to <dir2>.

    eg. to simply rename a file type mv <file> <new name>.

  3. cp <file> <dir2> copies a file to dir2.

  4. rm <file> removes a file.

  5. mkdir <dir> makes a directory.

  6. rmdir <dir> removes a directory.

  7. rm -r <dir> recursively removes the directory and all subdirectory files and directories.

  8. man <program> outputs the manual page for the program.

    eg. man cp will tell you how to copy files.