Unix 3 -- Simple Unix Commands
[Return to Math 10 Homepage]
[Return to Unix 2 Page |
Go to Unix 4 Page ]
Contents
Depending on which machine is used to connect to math and whether
one uses the CDE interface or not, one may need to reset the terminal
type.
If one uses telnet from non-X-Windows machine, it is best to reset
the terminal either when prompted at login (if using the C-shell) to
vt220 or by using the C-shell command:
set term=vt220
If one uses the CDE interface or connects to math
from a Unix X-Windows machine, one can set the terminal to
xterm instead of to vt220.
Aside from the standard alphanumeric keys on a keyboard, the
keyboard keys are not consistent in their interpretation from
computer to computer and even in the same operating system on
different machines.
In particular, there are differences as to which key to use to
erase the previously typed characters.
Part of the confusion is that some systems redefine the "rubout"
feature upon login and do this differently than other systems.
In general, on the HP system, one should use the backspace
key to erase the previously written character and not
the Delete key (which will produce the character "^?").
On some other Unix systems, one needs to invoke a <ctrl>h
to force an erasure.
Please note, once again, that on other Unix systems, the key or
key combination used to erase a character may be different!
The following are some of the most commonly used commands in Unix.
- ls
lists the filenames in the current directory. Optionally, one can
indicate a filename or part of a filename with the * wildcard.
- ls -a
lists the filenames in the current directory including those usually
hidden, i.e., those with a period as the initial character.
- ls -l
lists the filenames in the current directory in long format, i.e.,
with protection, ownership, and date of last modification. (Note:
ls -al gives both the long format and all hidden files since
both "switches" are included together.)
- cd
change to the home directory.
- cd directory_name
changes directory to the directory listed.
- mkdir directory_name
makes a new subdiretory with the name directory_name.
- rmdir directory_name
deletes (ReMoves) the subdiretory with the name directory_name.
- pwd
indicates the present working directory.
- fg
restarts a job suspended by <cntl>z.
- more filename
types the filename indicated on the screen
- rm filename
deletes the filename indicated.
- compress filename
compresses the filename indicated.
- uncompress filename
uncompresses the filename indicated.
- lp filename
prints the filename indicated on the line printer. By default,
math prints to the O'Connor printer and the printout will include
a header page. (On some systems lpr also works.)
To print to one of the Kenna lab printers or one of the
Orradre lab printers, you must include a "switch" before
the filename to indicate the destination. The "switch" consists
of two characters -d followed by one of the following:
kenna1 kenna2 orradre1 orradre2.
Thus, for example, to print the file mp1ou.output to
one of the Kenna printers, one types:
math 23: lp -d kenna1 mp1ou.out
and to print the file mp1ou.output to
one of the Orradre printers, one types:
math 24: lp -d orradre1 mp1ou.out
(The "-d" "switch" indicate the "destination" printer that the
file should be sent to. There are two printers in Kenna and
Orradre, designated "kenna1" and "kenna2" and similarly two
in Orradre. You can use any of them.)
- man command
invokes the on-line manual for the command command.
- cat filename
concatenates filename. If there is no other argument,
filename appears on the screen. If one want to
combine (i.e., concatenate) two files into a third, one invokes:
cat file1 file2 > file3
- grep string filename
locates the places where string occurs in file filename.
- man command
invokes the on-line manual for the command command.
- mv file1 file2
renames (i.e., moves) file1 to file2 (a file can be
moved to another directory if desired.
- cp file1 file2
copies file1 to file2.
- passwd
initiates the program for changing your password.
- alias string1 string2
make string1 an alias for string2 no matter whether
string2 is an email address or system command with switches.
Such aliases may be included in a .login file or a .mailrc file.
- jobs
reports on the names of suspended jobs.
- finger
indicates current users. finger username gives the
status of username. On the HP system, finger -R
indicates the location from which a user has logged into the system
either by domain name or IP address.
In the individual format, if username
has a .plan file and a .project file in the
home directory,
the finger command will also print that information out for the
person invoking it.
- printenv
indicates the values of all the ENVIRONMENT variables.
REMEMBER: Each of these commands has fuller information
on-line obtainable by using the man feature.
[Return to Math 10 Homepage]
[Return to Unix 2 Page |
Go to Unix 4 Page ]
This page is maintained by Dennis C. Smolarski, S.J.
dsmolarski@math.scu.edu
© Copyright 1998, 1999, 2000 Dennis C. Smolarski, SJ, All rights reserved.
Last changed: 21 September 2000.