
This tutorial contains step-by-step instructions for using the UNIX systems at UTD. This is a lengthy document. To facilitate ease of movement, the following links are provided to each major section:
- Logging in, Changing Your Password, and Logging Out
- Executing Unix Commands
- Directory and File Commands
- Printer Commands
- Editing Commands
- Electronic Mail
In addition, each major section includes a Back to Top link, which returns the reader to this table of contents.
Some of the commonly used software packages publicly available on apache and inca are:
|
Software
Software Development
FORTRAN compilers
C/C++ compilers
Pascal compiler
MATLAB
Mathematica
Netscape
SAS
Pine (email)
TIN (newsgroups)
|
Command(s) to start
workshop
f77, f9
gcc/g++, cc/CC
pc
matlab
math, mathematica
netscape
sas
pine
tin
|
Many of these packages have online help once started from the command line, and some will have manual pages as well (e.g., man gcc ).
For a common UNIX command list, see Commands on the UNIX Servers at UTD.
1. Logging in, Changing Your Password, and Logging Out
You may access a UNIX server from a PC through the UTDNet menu on or off campus by:
- selecting the menu option for the desired server, such as "APACHE (Applications Server)"
- telnet to the server from another UNIX host by typing, for example, telnet inca when you are already logged into another machine, such as apache. Remember that although you are logging in to inca you remain logged in to apache; to completely log out, (e.g.,) first log out of inca and then apache.
- by entering (for example) apache from a WYSE terminal, or by directly entering your username and password on a workstation or NCD Terminal at the machine login prompt. For more information on dialing in from off-campus, see the TCS document Communicating with the UTD Computer System from Off Campus. For more information on connecting to UNIX Servers on-campus, see Using the Campus Ethernet and the UTDNet Menu Software.
You must have a user account, including a user (or login) name and password, set up on the UNIX platform before you can login. To get a faculty sponsored UNIX account, fill out the Academic Computer Account Request Form and request UNIX on it. For an On-demand instructional UNIX account, or to obtain an Account Request Form, see the computer assistants (CAs) in the Jonsson Computing Center (UNIX lab) or McDermott Microcomputer Center. Please allow at least 24 hours from the time you have turned in the account request form until the account becomes active.
UNIX is case sensitive; that is, it knows the difference between upper and lower case letters. (Most commands and system directories are in lower case. User names are also in lower case; therefore, you should not login with upper case letters. Be sure to enter your username and initial password exactly as it is printed by the Account Management System, on the sheet you received for the UNIX platform. Also remember that you are held accountable for any activities done under your account, and it is therefore quite important to keep your password private.
1. Logging In
- After connecting to a UNIX host by one of the ways mentioned above, enter your username (case is significant!) at the login prompt; e.g., suppose your username is jsmith. You would enter:
login: jsmith
You will now be prompted for your password as shown:
Password:
- Type your password (again, pay attention to case) at the password prompt and press Enter. Your password will not appear as you type it; i.e., your password is not echoed to the screen. Some messages similar to these will be displayed on your screen:
Last login: Tue Oct 8 08:43:12 from apache.utdallas.
- You will receive a BASH shell prompt such as
{apache:~}
and you are now ready to begin working.
2. Changing Your Password
- In order to change your password please visit the NetID website and login using your NetID and current password. Once logged in you can change your password.
3. Logging Out
- To leave UNIX when you are logged in to a WYSE terminal or from Dialup, enter the log out command:
{apache:~} log out
Alternatively, you may press Control-d (to disconnect). Please make sure you are totally logged out before leaving the terminal. You can recognize this when you again have the same prompt that was displayed before you logged in.
If you are running X-Windows, such as from an NCD term in Jonsson lab, you must depress the "setup" button on the upper-right corner of your keyboard. Click on the "Login" menu in the "Console Window" that appears and select the "Log out" option. Re-affirm the log out when prompted, and wait until the "Login Chooser" menu is displayed. Remember, simply closing all your xterm windows may not log you out.
Back to Top
2. Executing Unix Commands
- Help on UNIX
To obtain complete on-line information on UNIX commands, use the man command to display manual pages. Type man followed by the command you need help on. For example, if you need help on the compiler gcc, enter:
{apache:~} man gcc
If you are not sure of the command, you may enter the man -k subject command, where subject is replaced by the topic you want to search for help on. It will list the headings of commands that are related to the subject. For example, to view a list of commands related to the topic 'directory:'
{apache:~} man -k directory
cd (1) - change working directory
chdir (2) - change current working directory
chdir (3F) - change working directory
chroot (2) - change root directory
ls (1) - list contents of a directory
mkdir (1) - make a directory
mkdir (2) - make a directory file
pwd (1) - working directory name
You could then use man to get more information about whichever command seems most relevant. The number in parentheses is the manual section.
Further instructions on using man pages can be had using man man.
man calls a command known as more to display the manual page. Use the following keys to control the scrolling capabilities while using more:
|
Spacebar
Return
b
q
/string
|
scroll forward one screen at-a-time.
scroll forward one line at-a-time.
move back one screen.
quit man pages.
search forward for that character string.
|
You will often need to use certain keyboard keys such as the Back Space key. Depending upon the terminal type you are using, the key actually labeled Back Space may not work. First, try the Delete key, then Back Space, and finally Control-H (or Ctrl-H).
Certain control characters are used to perform such tasks as correcting mistakes with command line input and stopping/starting screen output. The control characters are entered by holding down the Control key and pressing one other keyboard key. The Control key is displayed on your screen as the caret (^) symbol.
|
Key
Control-W
Control-U
Control-C
Control-S
Control-Q
Control-D
Control-Z
Up Arrow
Down Arrow
|
Function
Erases the last word altered on the command line.
Erases everything entered on the command line.
Interrupts execution of current command.
Stops screen output.
Starts screen output.
End-of-file.
Suspend command (advanced users only).
Recall Previous Command (scroll backward).
Recall Previous Command (scroll forward).
|
Note: If you find your terminal "frozen" pressing Control-Q can unlock it.
Back to Top
Directory And File Commands
Listing Available Files
Use the ls command to list the files in a directory. For example:
| |
{apache:~} ls |
| Mail |
cakewalk.cls |
public_html |
| news |
dead.letter |
|
Use the -a option to list all files (includes your dot files such as .bash_profile, which you usually wont care to see):
| |
{apache:~} ls
-a |
| . |
.bash_profile |
.xsession |
| .. |
.localhosts |
Mail |
Use the -l option to display a long listing of files and directories, which includes permissions, hard link count, file ownership, file size in bytes, modification date and time, and file or directory name:
| |
{apache:~} ls -l |
| drwxr-xr-x |
2 |
jsmith |
sn |
512 |
May 17 |
11:26 |
Mail |
You may put all the options, or switches, together for a complete listing of all files. Because this list will scroll faster than is readable, you may pipe (|) it through the more command, as such:
Note: This command has actually already been programmed into your environment as the shortcut, or alias, dir. This means that anytime that you type dir, the command ls -la|more will be executed instead. To see which other aliases weve provided you with, type alias at the command line. For information on how to make your own aliases, which you can insert into your own .bashrc or .cshrc file to have them load automatically each time you log in, view the man page on alias.
Back to Top
Directory Commands
To display the name of your current directory, use the pwd command (print working directory). For example:
{apache:~} pwd /home/zen/jsmith
You may also have noticed that your prompt tells you which server you are logged into. To the right of the host name, your current directory is also displayed. In the example above the user is in his home directory, which is denoted by the tilde ~, or ~jsmith. To change your current directory to a new directory, use the cd directory_name (change directory) command. If you do not specify the directory name, you will be placed in your home directory. cd .. will take you up one level in the directory structure.
{apache:~} pwd /home/zen/jsmith
{apache:~} cd Mail {apache:~/Mail} pwd /home/zen/jsmith/Mail
{apache:~/Mail} cd {apache:~} cd .. {apache:home/zen} pwd /home/zen
{apache:home/zen} cd ~ {apache:~} pwd /home/zen/jsmith
To create a new directory, you may use the mkdir command (make directory).
{apache:~} mkdir test
You can then use the ls command to see that the new directory is there. To remove a directory, you must first make sure that you delete all the files in that directory, including "dot files" and then use the rmdir command (remove directory) For example:
{apache:~} rmdir test
Back to Top
Disk Space
To find out how much disk space you are allotted, use the quota command:
| |
{apache:~} quota
-v |
| disk quotas
for jsmith (uid 12345): |
| filesystem |
usage |
quota |
limit |
timeleft |
files |
quota |
limit |
| /home/zen |
5698 |
10000 |
15000 |
|
153 |
25000 |
50000 |
This shows you which directory contains your home directory, how many 100 kilobytes you are using, how many you are allotted( ie: your quota), and what the absolute limit is. You may use the command du to see a listing of your disk usage by directory. Keeping your disk usage below your quota will ensure that you avoid any penalties for excessive disk-space usage.
Back to Top
File Commands
The more command will display files to your screen. More information about using it can be found in the man command section above.
{apache:~} more .bash_profile
The cp command copies a file. You first specify the name of the file you want to copy and then the name of the file to be the copy. The following cp command copies the contents of the file payroll.tst to a file called payroll.old.
{apache:~} cp payroll.tst payroll.old
The mv command changes the name of a file, or moves it to a new location.
{apache:~} mv output.dat results1
The rm command removes (deletes) files. This is the command that usually causes the greatest trouble for new Unix users. Try "man rm" as a first resort when this happens.
{apache:~} rm a.out
The chmod command allows you to change access rights, permissions, for the user (i.e.: you), members of your group (i.e.: other CS students), and all other users to access your files and directories. You control their permissions to read, write, and execute. The syntax is then : chmod ugo+/-rwx filename where you may use any combination of u, g, or o, either + or -, and any combination of r, w, or x, to respectively add or subtract the indicated permissions from the users that you specified. For example, if you create a public_html directory to have your own web page, you will need to give other users access to read from that directory and change to that directory, but you will probably want to disallow others from writing to that directory:
| |
{apache:~} chmod
go+rx public_html |
| {apache:~} chmod
go-w public_html |
| {apache:~} ls
-l |
| drwxr-xr-x |
2 |
jsmith |
sn |
|
512 |
sep 27 |
20:31 |
public_html/ |
From this line of the directory listing you can see first that this is a directory, second that the read, write and execute permissions are enabled for the user, and third that group users then other users each have read and execute permissions, but no write permission. Generally you want to disallow other users to write to your files.
Back to Top
Printer Commands
Printing is done by the lp command. The general syntax is lp -d printer_name filename. To print from the unix machines in the Johnson computer lab ask the Computer Assistant at the desk for the appropriate printer name. Once you know which printer you want to print to you can use the following command:
{apache:~} lp -d printer_name textfile.1
Back to Top
Editing Commands
The UNIX servers have three editors available. They are:
|
1. pico
|
|
This is a very easy to use and simple editor that is recommended for beginning users. Pico can be run by typing pico filename.
|
|
2. emacs
|
Emacs is an extremely powerful editor that is recommended for advanced users. Emacs can be run by typing emacs filename . To exit Emacs, press Ctrl-X Ctrl-C.
|
|
3. vi
|
vi is the standard UNIX editor. It is not recommended to new Unix users because it is somewhat difficult to learn. vi can be run by typing vi filename. You may exit by entering Esc :q!.
|
Back to Top
Electronic Mail
Electronic Mail can be sent by either the Pine or Netscape programs. Pine is the recommended package and can be invoked by typing pine.
Back to Top
|
|