The IRIX Interactive Desktop allows you to work with the IRIX operating system by pointing at and clicking on icons. You can also use the traditional interface to IRIX — the shell.
This Appendix explains how to start and stop IRIX shells and teaches you how to use some basic IRIX commands. It contains these sections:
The shell is the traditional interface to UNIX workstations. It is a window in which you type IRIX commands, and it is identical in structure to other windows. You can start additional shells by choosing Open Unix Shell from the Desktop toolchest. The shell window appears. Its fixtures look like those on other windows, but inside the body is a prompt (often a # or % sign) and a square cursor. See Figure A-1.
Move the cursor inside the window. Notice that the title bar highlights and the small green rectangle becomes solid. This indicates that the window is active; you can begin typing commands.
This section provides information on pathnames and background processes.
There are two types of pathnames: absolute pathnames and relative pathnames. An absolute pathname provides complete directions to a location in the IRIX file system, starting from the topmost directory. /usr/people/joe/reports and /usr/people/joe/Budgets/budget92 are examples of absolute pathnames.
A relative pathname is based on the directory in which you are currently working. For example, if you are in /usr/people/joe and want to open a file named reports, you type: vi reports. If you want to open a file in a subdirectory called Budgets, you type:
vi Budgets/filename
When you use IRIX commands to run an application, you can end the command line with the ampersand sign (&). This runs the application in the background so you can type other commands in the shell window and minimize the shell without quitting from the application.
Certain commands probably should not be run as background processes — the vi text editor for example. vi lets you create or edit a text file within the shell window. If you type vi &, the editor runs the but the text never appears in the shell window; you cannot read or edit the text.
Table A-1 lists the IRIX commands discussed in this chapter and provides a quick summary and example for each.
Table A-1. Summary of IRIX Commands
Command | Use | Example |
---|---|---|
pwd | To determine your current working directory. | pwd |
cd | To change (move) to a different directory. | cd /usr/tmp |
ls | To list the contents of a directory. | ls /usr/tmp |
dirview | To open a Directory View window that displays the contents of a directory. | dirview /usr/tmp |
mkdir | To create new directories. | mkdir reports |
cp | To copy a file or directory. | cp oldfile oldfile.copy |
ln | To create a linked copy of a file. This lets you access one file from several different places. | ln images movies/images |
mv | To move and rename files and directories. | mv oldfilename newfilename This renames oldfilename. |
rm | To delete files. | rm oldfile |
rm -r | To delete all the files in a directory before deleting the directory itself. | rm -r /usr/people/joe/reports |
rmdir | To delete empty directories. | rmdir /usr/people/joe/reports |
lp | To print files. | lp images |
lpstat | To check the print queue. | lpstat -s |
chmod | To change permission settings for a file. | chmod go-wx images |
man | To open the man page for an IRIX command. | man lp |
man -t | This lets you print the specified man page. | man -t lp |
Certain special characters act as shortcuts.Table A-2 contains a list of these characters and an explanation of their use.
Character | Use | Example |
---|---|---|
* (wildcard) | A substitute for any number of characters. | ls *.doc |
? | A substitute for one character. | ls ch?.doc |
. | An abbreviation for the current working directory | dirview . |
.. | An abbreviation for the parent directory | cd .. |
~ | An abbreviation for your home directory | cd ~/reports |
!! | A command to repeat the last command you typed. |
|
^ | A symbol for replacing characters. | cp ch1.doc /usr/tmp |
The title bar of a Directory View window lists the name of the directory whose contents it displays. When you are typing commands in a shell window, you use the pwd command to find out the name of the directory in which you are located. pwd stands for print working directory, or loosely translated, “Where am I?”
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
At the prompt, type:
pwd |
Then press Enter.
The IRIX shell responds with a pathname.
cd is the IRIX command for changing from one directory to another. To use it:
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
Type cd, followed by the name of the directory to which you want to switch. For example, to switch to a directory named /usr/tmp, type:
cd /usr/tmp |
Then press Enter.
![]() | Tip: Two periods (..) is an abbreviation for the name of the parent directory. In other words, it says to go up one directory. Suppose you are working in /usr/people/joe/Reports and want to move to /usr/people/joe/Images. You can type: cd ../Images cd alone takes you to your home directory. |
ls is the IRIX command for opening and displaying the contents of a directory. To use the ls command:
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
Use the cd command to move to the directory whose contents you want to view. For example, type:
cd /usr/people/<loginname> |
Then press Enter.
Type:
ls |
Then press Enter.
The contents of your home directory appear as a list.
IRIX can give you a more informative listing when you use an option with the ls command.
The -a option lists all of the files, even those that begin with a period (.)
The -F option with ls:
Puts an asterisk (*) next to all programs
Puts a trailing slash (/) after all directories
Does not add any characters to plain text files
dirview is the IRIX command to open a Directory View window. Directory View windows display the contents of a directory graphically. To use the dirview command:
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
Type dirview, followed by the name of the directory whose contents you want to display in a Directory View window. For example, to open a Directory View window for /usr/sbin, type:
dirview /usr/sbin |
![]() | Tip: To open a Directory View window for the directory you are currently working in, type: dirview . A period (.) is an abbreviation for the name of your current working directory. |
mkdir is the IRIX command for making a new directory. The following example shows how to make a new directory called sub in your home directory.
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
Use the cd command to move to the directory in which you want to create a new directory. For example, type:
cd /usr/people/<loginname> |
Then press Enter.
Type:
mkdir sub |
Then press Enter.
This command creates a directory called sub in your home directory.
See “Creating a Directory” in Chapter 4 to learn how to create new directories using the graphical interface.
cp is the IRIX command for copying files and directories. The following example shows how to to copy a file called oldfile.
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
Type:
cp oldfile oldfile.copy |
Then press Enter.
This command means “copy oldfile from my current working directory into a file named oldfile.copy in my current working directory.” To place the copy in a different directory, add a pathname before the new file name.
See “Copying Files or Directories” in Chapter 4 to learn how to copy files using the graphical interface.
ln is the IRIX command for creating linked copies. A linked copy lets you create different names for one file. Suppose you have a file named images in /usr/people/joe. You work in /usr/people/joe/movies quite frequently and want to easily access the images file.
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
Use the cd command to move to the /usr/people/joe directory. Type:
cd /usr/people/joe |
Then type:
ln -s images movies/images |
![]() | Note: You could also give the file a different name. |
See “Making a Referenced Copy of an Icon” in Chapter 4 to learn how to make linked copies using the IRIX Interactive Desktop.
mv is the IRIX command for renaming and moving files and directories.
To rename a file using the mv command:
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
Type:
mv oldfilename newfilename |
oldfilename is now named newfilename.
![]() | Note: Do not use blank spaces when renaming files using IRIX commands. IRIX does not replace blank spaces with underscores, so you'll have problems accessing the file later. |
To move oldfile from /usr/people/joe to /usr/tmp:
Place the cursor in the shell window.
Type:
mv oldfilename /usr/tmp/oldfilename |
See “Renaming Files and Directories” in Chapter 4 to learn how to rename files using the graphical interface; see “Moving and Copying Files and Directories” in Chapter 4 to learn how to move files using the graphical interface.
rm is the IRIX command for deleting files. You type rm followed by the name of the file you want to delete. For example, to delete a file named oldfile:
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
Type:
rm oldfile |
This deletes the file named oldfile in your current working directory.
See “Removing Files and Reference Icons” in Chapter 4 to learn how to delete files using the Remove command.
rmdir is the IRIX command for deleting an empty directory; an option to the rm command lets you delete a directory and all of the files it contains.
To delete an empty directory:
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
Use the cd command to move to the directory that contains the empty directory you want to delete. For example, if you want to delete a directory named oldfiles in /usr/people/joe, type:
cd /usr/people/joe |
Then press Enter.
Type:
rmdir oldfiles |
Then press Enter.
The oldfiles directory is deleted.
To delete a directory and all of the files it contains:
Use the cd command to move to the directory that contains the directory you want to delete. For example, if you want to delete a directory named oldfiles in /usr/people/joe, type:
cd /usr/people/joe |
Then press Enter.
Type:
rm -r oldfiles |
Then press Enter.
This deletes all of the files in the directory, then deletes the oldfiles directory itself.
You can easily print from your IRIS workstation using the graphical tools and menu commands. This section describes an alternative — printing using the lp command and checking the status of a print request using the lpstat command.
lp is the IRIX command for printing a file. You type lp followed by the name of the file you want to print. The file prints on your default printer. For example, to print a file named images:
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
Type:
lp images |
Then press Enter.
To print to a printer other than the default, you can use the -d option to lp. For example, to print images to a printer named printer2, you would type:
lp -dprinter2 images |
See the Personal System Administration Guid for instructions on installing the printer. See the lp
lpstat is the IRIX command for displaying the list of print requests that have been sent to a printer. The -s option provides a summary of your print requests.
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
Type:
lpstat -s |
Then press Enter.
See “Viewing the Queue of Print Jobs” in Chapter 5 to learn how to use the Print Manager to check the status of your print requests. See the lpstat man page for a list of all the available options and capabilities.
chmod is the IRIX command you use to change permission settings for a file. You can specify Read (r), Write (w), and Execute (x) permissions for the file's owner (u), the group (g), and others (o).
You type chmod followed by the permission setting information followed by the file name whose settings you are changing. The permission setting information has several parts. You specify:
Who is affected by the change (u, g, o)
Whether you are adding or taking away permissions
Which permissions are affected (r, w, x)
For example, suppose you have a file named images that everyone can read, write, and execute. You decide you want to prevent all others from writing and executing the file.
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
Type:
chmod go-wx images |
Then press Enter.
See “Changing Permissions” in Chapter 9 to find out about an easy-to-use interface for changing permissions.
By default, your IRIS workstation contains online man pages that have information on all IRIX commands. For example, to access a man page for the ls command:
Place the cursor in the shell window.
To open a shell window, choose Shell from the Tools toolchest. See “Opening a Shell Window ” for step-by-step instructions.
Type:
man ls |
Then press Enter.
After a few moments the man page is displayed.
![]() | Note: The -t option lets you print a man page. For example, to print the man page for the lp command, you type: man -t lp |