ContentsIn this Document UNIX is the operating system on the ITS CCWF system (accounting code HPW), the UNIX Timesharing System (UTS), and the Academic Data Server (ADS). Each computer system uses a different version of UNIX: CCWF uses Solaris, UTS uses Digital UNIX, and ADS uses AIX. This reference list gives a quick overview of common UNIX features and commands. The most current and complete information for any command is its online "man" page--see "Getting Online Help" below for more information. ACITS also publishes an inexpensive manual, Introduction to UNIX (CCUG-1), which can be purchased at the Help Desk in the Varsity Center (VRC). The manual can also be viewed or searched online, using a Web browser, at In this Document . . .
Connecting and Logging InConnecting from Another ComputerIf you are using another computer on the campus network (UTnet) or on the Internet, and if that computer has a telnet command, you can use it to connect to a UNIX host. If the other computer is also running UNIX, you can connect using rlogin. If your computer offers ssh, the Secure SHell, you can also connect using ssh or slogin. Connecting through TelesysYou must have a modem and a computer, and your user number must be validated to use the Telesys dial-up system. If you use SLIP or PPP software provided in the UT Connect package, it will make the Telesys connection, and you can use telnet to connect to a UNIX host. Logging In For your first login, your login name is the user number issued to you by ACITS, in lowercase. When the UNIX system prompts you for a password, give the password originally issued for your user number, also in lowercase. For your first login, a special program will prompt you for a new UNIX password, possibly for a new UNIX login name, and for other initialization information. Then it will log you out. The login name you choose must be unique: it cannot be used by anyone else on the system. It will also be part of your e-mail address, so you should choose something appropriate. Make up a password that is six or more characters long, mixing uppercase, lowercase, and numbers to make it difficult for others to guess. This password is the only thing that keeps someone else from using your account and having full access to your work. The program may ask you to choose a login shell, which is a UNIX command interpreter. The C shell (/bin/csh) is recommended. For this document, the C shell is assumed to be the command interpreter-unless otherwise stated. The program will also prompt you for optional data to put into a database that other users on the Internet can view. This includes such items as your name, office address, and phone number. Press RETURN to leave any item blank. To add or change data in a later session, use the command:
Exceptions: For the UTS system, you must run chfn on the machine named curly.cc.utexas.edu. For the ADS and CCWF systems, send your request to The Shell's Prompt for CommandsAfter you log in, you will see a prompt from the shell. The C shell's prompt usually includes the host machine's name. When you see the shell prompt, such as ccwf.cc.utexas.edu%, you can issue UNIX commands. Logging OutIMPORTANT: Don't just turn off the terminal or workstation or disconnect the phone, and do not abandon a terminal or workstation that seems "locked up". When you are through with your UNIX session, log out by typing:
If you see a new UNIX login prompt, press ^d again. If you see a new Telesys> prompt, type:
If you can't get a response at all and are unable to log out, see "Killing a Detached or Runaway Job" in this document. Changing Your PasswordTo change your password, type the command:
You will be prompted for your old password, then for your new one (twice for confirmation). If the two new passwords match, the change will take effect in about one hour. If they do not match or are otherwise unacceptable, you will be prompted to try again. Neither the old nor new password will display on the screen. Changing your password on UTS, which must be done on the machine named curly.cc.utexas.edu, does not affect your password for Telesys, CCWF, ADS, UMBS, or any other system. Correcting Typing ErrorsTo correct an error before you press the RETURN key:
Special Characters^c ^z
<
mails the contents of file "note" to user jsmith instead of prompting for text from your terminal ("standard input"). >
displays contents of "myfile" at your terminal (standard output), but:
copies it to file "listout" instead, overwriting and destroying any previous contents of the file "listout". (In the C shell, a prior set noclobber command prevents such destruction.) >>
appends a copy of "nextfile" to file "listout" instead of overwriting what is already in "listout". |
sends output from the ls (listing) program to the lpr (printing) program. * ? \ The shell performs filename matching and input/output redirection before calling any program that uses the files. Setting Your Terminal TypeSome programs must know what type of terminal you are using in order to process control characters correctly. To identify your terminal to the C shell, give the command:
where type is the terminal type, such as vt100. Your terminal type should already be defined by initialization files set up for you when you first used a particular ACITS UNIX system. Getting Online HelpOnline UNIX documentation consists of "man" (manual), pages that you can display or print by using the man program. For example, to display the man page for the rm (remove) program, type:
For information on the man program itself, type:
The program pauses after displaying each screenful of text. Press the space bar to continue, or press q to quit. To print a man page, "pipe" the output of the man program to the ul program (for underline and boldface removal, which some printers can't do) then pipe that output to the lpr program--like this:
This prints the rm man page on the laser printer at the Student Microcomputer Facility. If you don't know which man page you need, type:
to get a list of man pages that contain keyword in their title lines. On the ADS system, get additional online help by using the InfoExplorer program. Type info -h to get started. Longer documents and frequently asked questions can be searched and displayed by using your Web browser to connect to: Files and DirectoriesA UNIX filename or directory name can contain up to 255 letters, digits, and punctuation characters (best limited to period and underscore). To list names of files in your own directory, type:
This will not list filenames that begin with a period, unless you include the -a (all) option, like this:
Names of initialization files typically begin with a period. For example, the C shell executes commands in .login each time you log in, and those in .cshrc each time you start up the C shell. The initialization file for the Bourne shell or the Korn shell is .profile. Other ls options include: -l -F To list a subset of your files, use special characters. For example, to list all filenames beginning with A, use:
For complete information about the ls command, see: man ls Creating and Editing FilesTo create and alter files on a UNIX system, use a text editor. The most common one is the vi editor. Its use is described in Introduction to UNIX, CCUG-1. The pico editor is very easy to use, with an on-screen menu of commands and built-in help. Emacs is another popular editor. A summary of Emacs commands is in GNU Emacs Pocket Reference List, CCRL-34, available free at the Help Desk. NOTE: To use most editors, your terminal type will need to be defined. A definition of vt100 works in most cases. Displaying a File at Your TerminalUse the cat (catenate) or more command to display files at your terminal. For example:
displays "source1" and "source2" in that order.
displays "testfile", pausing after each screenful. Press the space bar to see each new screen. Printing a FileTo send files to a printer, use lpr. For example:
prints files "source1" and "source2" on a laser printer at the Student Microcomputer Facility (SMF) in the Flawn Academic Center (FAC). For information about options, output devices, and locations, see:
On ADS, use InfoExplorer. To learn how, type
Deleting a FileUse rm (remove) to delete files from your directory. For example:
The -i (interactive) option to rm causes the system to request confirmation of each file deletion. This option may prevent accidental deletions and is useful if you are removing several files, as in:
To delete a file that starts with a hyphen, use
Setting a Search PathYour command search path is the sequence of directories the shell searches to find commands you issue. For the C shell, to add a directory to the search path, use set path. For example: set path=($path /usr/lang) ; rehash adds /usr/lang to your current search path, $path. But this works only for the current login session. If you want your path set as above for EVERY login session, put the set path command in your .login file. Killing a Detached or Runaway JobIf your terminal gets disconnected from your job or if it "locks up", you can kill the detached processes this way:
Running ProgramsTo compile a Fortran program using the UNIX FORTRAN-77 compiler, f77, type:
where file is the name of the source file. On ADS, you can also use xlf or xlf90. If the source filename ends in .f it is taken to be a FORTRAN-77 program. To compile a Pascal program, type:
where file is the name of the Pascal source file, which normally has .p as its final two characters. Exception: on ADS systems, use
To compile a C program, type:
where file is the name of the C source file, normally having .c as its last two characters. On ADS systems, you can also use xlc. To compile a C++ program with the GNU C++ compiler, type
All of these compilers compile and load object code into executable files named a.out. To execute your program, simply type:
If you get the message "a.out: Command not found", check to be sure that your command search path is set correctly. Or you may be able to solve the problem by using the command:
to specify your current working directory. To write object code to some file other than a.out, use the -o compiler option, like this:
where output is the name of your executable file. To compile only, use the -c option. In this case, the compiled program is written to a file with the same name as the source file but with the final .f, .p, or .c replaced by .o; no loading or linking takes place. NOTE: Programs compiled on one machine architecture will not run on another. For example, an a.out file compiled on the CCWF system will not execute on UTS. To debug your C, Pascal, FORTRAN, and assembly language programs, compile them with the -g option, then use an interactive debugging program. For information on available debugging programs, type:
For other compiler options, see the man pages for f77, PC, and cc. On UNIX systems running AIX, see the man pages for xlf, xlc, and xlp. To print a listing of your program, type:
To include line numbers, use:
Summary of Useful CommandsThe following commands are grouped alphabetically by function. Unless noted otherwise, each has a man page describing it in full. Commands marked "C shell only" are described in the csh man page (except on ADS systems, where you should use InfoExplorer for information). Access Control
Communications
Programming Tools
Documentation
Editors
File and Directory Management
File Display and Printing
File Transfer
Miscellaneous
News/Networks
Process Control (The following commands function under the C shell, bash, and ksh. They do not have separate man pages.)
Status Information
Text Processing
Last updated May 2, 2002.
To submit questions or comments regarding this page, use the online Comment Form.
|