| Shells | Disk Quota | File Permissions | Typing Commands | Special Characters | Return to Lab Home Page |
When you open a terminal window on a SPARC station, or when you telnet into the Intranet, you are using a program called a shell. The shell displays the % prompt on the screen and processes the commands you type. There are several shell programs available. Unless you change it,
you are using the tcshell .
(It is sometimes important to know which shell you are using. Other shells, such as the Bourne and Korn shells, do not process commands the same way) To verify which shell you are using, at the % prompt type echo $SHELL Each Intranet account is given a portion of disk space to be used for
storing personal files. If you fill your allotted space, you will not be able to access your account again. Use the Intranet Services form to check how much of your storage space is remaining. Since you are sharing storage space with many other users, "permissions" are set to prevent other users from accessing your files. If you need to give a professor permission to view your homework, or give the world access to view your web page, use the
Intranet Services form. The tcshell keeps a "history" list of commands you have typed. If you press the up arrow key, the previous command you typed will be displayed on the screen. This is useful when you make a typographic error. You can display and edit
the previous line without retyping it all. Commands are case sensitive. (That is, the capital letter B and a lower case b are not treated as the same). Spacing is important! Putting a space in the wrong place, or not putting a space where it is needed, will prevent a command from operating correctly. The order of entries is important. The first item is the name of a program (the command - usually in lowercase). The command may be followed by options, as appropriate. Options are preceded by a dash. File or directory name(s) are
usually last, when they are needed. For example: %ls is a command to list the files in a directory %ls -l the dash is used to identify that the next character is an option. In this case, l stands for "long" which gives the long display. Notice that there must be a space between the command and the dash, but no space between the dash and the option (An option is like an "adverb". It modifies the way the command (the "verb) works. %ls -l myfile The last entry is the name of a file.In this case, you want to display the long listing for only one file. There are 3 entries on the line, and a space between each entry. Some keyboard characters have special meanings For example: Keyboard Character Named Stands for: . Dot or period A dot used as the first character of a file name indicates a "hidden" system file. A dot used in place of a directory name indicates the current working directory. .. Double dot Used as a directory name, refers to the "parent" directory / Forward slash Root directory (also used to separate directory names in a complete path name) * Asterisk A "wildcard" character - Dash Precedes an "option" following a command ~ Tilde A tilde character in front of a username is a "shortcut" used instead of typing the entire path name to that user's home directory ; Semicolon A semicolon is used to separate two commands on one line & Ampersand Run the previous command in the background && Double Ampersand Run the comand following this only if the previous command completes successfully. For
example:
grep string filename && cat filename
|| Double Pipe Run the comand following this only if the previous command did not complete successfully.
For
example:
grep string filename || echo "String not found"
( ) Parentheses
The command within the parentheses is executed in a sub-shell
' ' Forward Single Quotes
Don't allow any special meaning to any characters within these quotations.
' ' Double Quotes
Allow variable and command substitutions within these quotes
`command` Back Quotes
Take the output of the command inside the back quotes and substitute it as an argument on the command
line
\ Backslash
Take the following character literally. Also used to "escape" a new-line character so you can
continue a command on more than one line.
Shells
Your Disk Quota
File Permissions
Unix Commands
Refer to these Unix references for lists of Unix commands and how to use them.
Typing UNIX Commands : Tips & Traps
Page Created by Joy Compton -- jcompton@csupomona.edu
Last Revised: July 19, 2000