Linux Tutorial for new users

  • Last updated June 27, 2005

    General format of most commands

    1. Most commands follow a general structure which is COMMAND -OPTIONS SOURCE OUTPUT/DESTINATION
    2. Each of these 4 parts are separated by a single space (nothing more or less). Each part is explained below
      • COMMAND tells the computer generally what to do like copying or moving files for example or running a specific program. Not all commands need the other 3 parts of a general command (like with running applications).
      • OPTIONS follow the COMMAND preceeded by a - and multiple options can be specified by typing the letter of the options with no space. For example COMMAND -hr will specify the h and r option (doing -h -r does the same thing). You can use multiple options as long as it relates/usable by that command. Some options are also whole words.
      • SOURCE is the input for the command or what file/directory the command should work on. If the file to be worked on is in the same directory as where your typing the command. If it is not then you must specify the directory. This can be done in 2 ways. (removing filename in examples for specifying directories)
        1) The first directly specifies where the file is by typing the whole directory structure beginning with / and separated with / for each level of the directory. For example COMMAND /home/fMRI/welcome.doc telling the command the precise location of the file.
        2) The second method is to specify relative to where you are already by using a ./ (period slash). Say you are in /home/fMRI/ and you type in COMMAND ./subjects/202.doc. This tells the computer to work on the file 202.doc in /home/fMRI/subjects/202.doc.
      • OUTPUT/DESTINATION specifies how the file after being processed by the command should be named (OUTPUT) or the directory is should be put in (DESTINATION). This follows the same directory rules as SOURCE.

    Commonly used commands (with commonly used options) (commands are encased in [])

    Wildcards/Shortcuts

    Applications

    Scripts

    Other Comments

    by Francis Shih 2005

    Back to U of S fMRI web page.