home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  

Book HomeBook TitleSearch this book

B.2. Alphabetical Summary of Commands


bfs [option] file

Big file scanner. Read a large file, using ed-like syntax. This command is more efficient than ed for scanning very large files because the file is not read into a buffer. Files can be up to 1024K bytes. bfs can be used to view a large file and identify sections to be divided with csplit. Not too useful.


Do not print the file size.


cof2elf [options] files

Convert one or more COFF files to ELF format, overwriting the original contents. Input can be object files or archives.


Ignore unrecognized data; do the conversion anyway.

Quiet mode; suppress messages while running.

Print information about cof2elf in output (if c = y) or suppress information (if c = n, the default).

Save the original files to an existing directory dir.

Print the version of cof2elf on standard error.


crypt [password] < file > encryptedfile

Encrypt a file to prevent unauthorized access. password is either a string of characters you choose or the option -k, which assigns the value of the environment variable CRYPTKEY (Solaris: CrYpTkEy) as the password. The same password encrypts a file or decrypts an encrypted file. If no password is given, crypt prompts for one. crypt is available only in the United States (due to export restrictions).

The algorithm used is considered weak, and this command should not be used for serious encryption. See PGP: Pretty Good Privacy, listed in the Bibliography.


cu [options] [destination] [command]

Call up another Unix system or a terminal via a direct line or a modem. A non-Unix system can also be called.


Process lines using n-bit characters (7 or 8).

Search UUCP's Devices file and select the local area network that matches name (this assumes connection to a system).

Instead of entering interactive mode, run the command from the command line with standard input and standard output connected to the remote system. Solaris only.

Print diagnostics.

Send even-parity data to remote system.

Emulate local echo and support calls to other systems expecting terminals to use half duplex mode.

Ignore one hangup. Useful when calling a remote system that will disconnect and call you back with a login prompt. Solaris only.

Communicate on device named line (e.g., /dev/tty001).

Use the chat sequence specified in /etc/uucp/Systems. Solaris only.

Prompt user for a telephone number.

Use odd parity (opposite of -e).

Set transmission rate to n (e.g., 1200, 2400, 9600 bps). Default is Any.

Dial an ASCII terminal that has auto-answer set.



The telephone number of the modem to connect to.


Call the system known to uucp (run uuname to list valid system names).


An address specific to your local area network.

cu runs as two processes: transmit and receive. Transmit reads from standard input and passes characters to the remote system; receive reads data from the remote system and passes lines to standard output. Lines that begin with a tilde (~) are treated as commands and not passed.

Transmit Options

Terminate the conversation.

Escape to an interactive shell on the local system.

~!cmd ...
Run command on local system (via sh -c).

~$cmd ...
Run command locally; send output to remote system.

Change directory on the local system.

~%take file [target]
Copy file from remote system to target on the local system. If target is omitted, file is used in both places. The remote system must be running Unix for this command to work. No checksumming of the transmitted data is provided.

~%put file [target]
Copy file from the local system to target on the remote system. If target is omitted, file is used in both places. The remote system must be running Unix for this command to work. No checksumming of the transmitted data is provided.

~~ ...
Use two tildes when you want to pass a line that begins with a tilde. This lets you issue commands to more than one system in a cu chain. For example, use ~~. to terminate the conversation on a second system cu d to from the first.

Send a BREAK sequence to the remote system.

Turn debug mode on or off.

Print termio structure for local terminal. (Intended for debugging.)

Print termio structure for communication line. (Intended for debugging.)

Turn on/off the DC3/DC1 XOFF/XON control protocol (characters ^S, ^Q) for the remainder of the session (formerly ~%nostop, which is still valid).

Set output flow control either on or off.

Allow/prevent diversions not specified by ~%take.

Allow/prevent old-style syntax for diversions received.


Connect to terminal line /dev/ttya at 9600 baud:

cu -s9600 -l/dev/ttya

Connect to modem with phone number 555-9876:

cu 5559876

Connect to system named usenix:

cu usenix

face [options] [files]

Invoke the Framed Access Command Environment Interface and open files. By convention, each filename must be of the form Menu.string, Form.string, or Text.string, depending on the type of object being opened. If no files are specified, face opens the FACE menu along with the default objects specified by the environment variable LOGINWIN.


-a afile
Load the list of pathname aliases specified in the file afile. Entries have the form alias=pathname. Once this file is loaded, you can use the shorthand notation $alias to refer to a long pathname.

-c cfile
Load the list of command aliases specified in the file cfile. This file allows you to modify the default behavior of FACE commands or create new commands.

-i ifile
Load file ifile, which specifies startup features such as the introductory frame, banner information, screen colors, and labels.


fmli [options] files

Invoke the Form and Menu Language Interpreter and open files. By convention, each filename must be of the form Menu.string, Form.string, or Text.string, depending on the type of object being opened.


-a afile
Load the list of pathname aliases specified in the file afile. Entries have the form alias=pathname. Once this file is loaded, you can use the shorthand notation $alias to refer to a long pathname.

-c cfile
Load the list of command aliases specified in the file cfile. This file allows you to modify the default behavior of FMLI commands or create new commands.

-i ifile
Load file ifile, which specifies startup features such as the introductory frame, banner information, screen colors, and labels.


fmtmsg [options] text

Print text as part of a formatted error message on standard error (or on the system console). text must be quoted as a single argument. fmtmsg is used in shell scripts to print messages in a standard format. Messages display as follows:

label:	severity:	text
TO FIX:	action		tag

You can define the MSGVERB variable to select which parts of the message to print. Each part is described with the options below.

The SEV_LEVEL environment variable allows you to add additional severities and associated strings to be printed when those severities are provided.


-a action
A string describing the first action to take in recovering the error. The string “TO FIX:” precedes the action string.

-c source
The source of the problem, where source is one of hard (hardware), soft (software), or firm (firmware).

-l label
Identify the message source with a text label, often of the form file:command.

-s severity
How serious the condition is. severity is one of halt, error, warn, or info.

-t tag
Another string identifier for the message.

-u types
Classify the message as one or more types (separated by commas). types can be one of the keywords appl, util, or opsys (meaning that the problem comes respectively from an application, utility, or the kernel), either of the keywords recov or nrecov (application will or won't recover), print (message displays on standard error), and console (message displays on system console).


fold [options] [files]

Break the lines of the named files so that they are no wider than the specified width. fold breaks lines exactly at the specified width, even in the middle of a word.


The line width specifies bytes, not characters. Solaris only.

Break lines after the last whitespace character within the first width characters. Solaris only.

-w n
Create lines having width n (default is 80). (Can also be invoked as -n for compatibility with BSD.)


ismpx [option]

Test whether standard input is running under layers. (Command name comes from “Is the multiplexor running?”) Output is either yes (exit status 0) or no (exit status 1). Useful for shell scripts that download programs to a layers windowing terminal or that depend on screen size.


Suppress output and return exit status only.


if ismpx -s
then jwin


Reset layer of windowing terminal after a program changes the terminal attributes of the layer. Used only under layers. Returns 0 on success, 1 otherwise.



Print size of current window in bytes. Used only under layers.


layers [options] [layers_program]

A layer multiplexor for DMD windowing terminals. layers manages asynchronous windows on a windowing terminal. layers_program is a file containing a firmware patch that layers downloads to the terminal (before layers are created or startup commands are executed).


Print sizes of the text, data, and bss portions of a downloaded firmware patch on standard error.

Print debugging messages on standard error.

-f file
Initialize layers with a configuration given by file. Each line of file is a layer to be created and has the format x1 y1 x2 y2 commands, specifying the origin, the opposite corner, and start-up commands. For example:

10 10 800 240 date; who; exec $SHELL
-h list
Supply a comma-separated list of STREAMS modules to push onto a layer.

-m size
Set data part of xt packets to maximum size (32–252).

Print downloading protocol statistics and a trace of a downloaded firmware patch on standard error.

Report protocol statistics on standard error after exiting layers.

Turn on xt driver packet tracing and produce a trace dump on standard error after exiting layers.


/usr/ccs/bin/lorder objfiles

Take object filenames (e.g., files with .o suffix) and output a list of related pairs. The first file listed includes references to external identifiers that are defined in the second. lorder output can be sent to tsort to make the ordering of files in an archive more efficient for loading.


To produce an ordered list of object files and replace them in the library libmyprog.a (provided they are newer):

ar cru libmyprog.a `lorder *.o | tsort`

/usr/ucb/lptest [length [n]]

Display all 96 printable ASCII characters on the standard output. Characters are printed in each position, forming a “ripple pattern.” You can specify the output line length (default is 79) and display n lines of output (default is 200). lptest is useful for testing printers and terminals or for running shell scripts with dummy input.


mailalias [options] names

Display the email addresses associated with one or more alias names. mailalias displays addresses that are listed in the files /var/mail/name, $HOME/lib/names, and in the files pointed to by the list in /etc/mail/namefiles. mailalias is called by mail.

Note: this command is part of the UPAS mailing system software. Commercial Unix systems all use sendmail, thus this command isn't applicable.


Suppress name s; show only corresponding mail address.

Verbose mode; show debugging information.


newform [options] files

Format files according to the options specified. newform resembles cut and paste and can be used to filter text output. Options can appear more than once and can be interspersed between files (except for -s, which must appear first).


Append n characters to the end of each line or, if n isn't specified, append characters until each line has the length specified by -l.

Delete n characters from beginning of each line or, if n isn't specified, delete characters until each line has the length specified by -l.

Use character m (instead of a space) when padding lines with -a or -p; -c must precede -a or -p.

Same as -b, but delete from the end.

Display tabspec format used by last -o option.

Expand tabs to spaces using tabspec conversion (default is 8 spaces); tabspec is one of the options listed under tabs.

Use line length n (default is 72). If -l is not specified, default line length is 80. -l usually precedes other options that modify line length (-a, -b, -c, -e, or -p).

Turn spaces into tabs using tabspec conversion.

Same as -a, but pad beginning of line.

Strip leading characters from each line (up to and including first tab); the first seven characters are moved to the end of the line (without the tab). All lines must contain at least one tab.


Remove sequence numbers from a COBOL program:

newform -l1 -b7 file

newgrp [-] [group]

Log in to group. If group name is not specified, your original group is reinstated. If - is given, log in using the same environment as when logging in as group. Solaris allows -l as well as -.

This command is also built in to the Bourne and Korn shells. On modern Unix systems that allow users to simultaneously be in multiple groups, this command is obsolete.


news [options] [item_files]

Consult the news directory for information on current events. With no arguments, news prints all current item_files. Items usually reside in /usr/news or /var/news.

Note: this command is not related to Usenet news.


Print all news items, whether current or not.

Print names of news items, but not their contents.

Report the number of current news items.


notify [options]

Inform user when new mail arrives. With no options, indicate whether automatic notification is enabled or disabled.

Note: this command is part of the UPAS mailing system software. Commercial Unix systems all use sendmail, thus, this command isn't applicable.


-m file
Save mail messages to file (default is $HOME/.mailfile). Applies only when automatic notification is enabled (-y option).

Disable mail notification. -n is used alone.

Enable mail notification.


/usr/openwin/bin/openwin [options]

Start the OpenWindows graphical user interface environment. This environment is now considered obsolete; the preferred environment is CDE (the Common Desktop Environment), and OpenWindows will not be supported past Solaris 7. See also cde in Chapter 2.

Useful OpenWindows Commands

The following OpenWindows commands may be of interest. Look at the manpages for more information:


On-screen scientific calculator




Calendar manager


Terminal emulator


Icon editor


Mail reader


A round clock


PostScript viewer


System-performance meter


Print manager


Another terminal emulator (respects stty settings)


Saves portions of X display


Simple text editor


Graphical mail arrival watchdog program


Simple on-screen calculator


Device-independent troff output viewer


Simple text editor


Controls permissions for who can connect to display


System load monitor


Screen saver/locker


Magnifies portions of the display


Viewer for manpages


Standard X Window system terminal emulator


pack [options] files

Compact each file and place the result in file.z. The original file is replaced. To restore packed files to their original form, see pcat and unpack.

The compress and gzip commands give much better compression. Their use is recommended. (See compress and gzip in Chapter 2.)


Print number of times each byte is used, relative frequency, and byte code.

Force the pack even when disk space isn't saved.


pcat files

Display (as with cat) one or more packed files. See also pack and unpack.


pg [options] [files]

Display the named files on a terminal, one page at a time. After each screen is displayed, you are prompted to display the next page by pressing the Return key. Press h for help with additional commands; press q to quit. See also more in Chapter 2.


Clear screen (same as -c of more).

Do not pause between files.

Do not split long lines.

Issue a pg command at the prompt without waiting for a carriage return (more works this way).

Use string str for the command prompt. The special variable %d displays the page number.

Restricted mode; shell escapes aren't allowed.

Display messages in standout mode (reverse video).

Use n lines for each window (default is a full screen).

Begin displaying at line number num.

Begin displaying at first line containing pattern pat.


pg -p 'Page %d :' file

red [options] [file]

Restricted version of ed. With red, only files in the current working directory can be edited. Shell commands using ! are not allowed.


relogin [option] [terminal]

Change the login entry to reflect the current window running under layers. This ensures that commands like who and write use the correct login information. layers calls relogin automatically, but you may sometimes want to use relogin to change the destination window for write messages. terminal is the filename of the terminal to change; e.g., ttyp0.


Don't print error messages.


ruptime [options]

Show the status of local networked machines (similar to uptime).

This command is generally no longer used because the supporting daemon generates an inordinate amount of unnecessary network traffic.


Include users even if they've been idle for more than one hour. Normally such users are not counted.

Sort by load average.

Reverse the sort order.

Sort by up time.

Sort by number of users.


rwho [option]

Report who is logged on for all machines on the local network (similar to who).

This command is generally no longer used because the supporting daemon generates an inordinate amount of unnecessary network traffic.


List users even if they've been idle for more than one hour.



Control more than one shell (layer) from a single terminal. From the shl prompt level, you can issue the commands listed below (abbreviating them to any unique prefix if desired). The name text string should not exceed eight characters. See also layers.

block name [name2 ...]
Block the output for each layer name (same as stty loblk).

create [name]
Create the layer name (no more than seven total).

delete name [name2 ...]
Delete the layer name.

help or ?
Provide shl command syntax.

layers [-l] [name ...]
Print information about layers. -l provides a ps-like display.

Make layer name be the current level.

Exit shl and kill all the layers.

resume [name]
Return to latest layer or to layer name.

Flip back to the previous layer.

unblock name [name2 ...]
Do not block output for each layer name (same as stty -loblk).


sum [option] file

Calculate and print a checksum and the number of (512-byte) blocks for file. Possibly useful for verifying data transmission. See also cksum in Chapter 2.

Note: /usr/ucb/sum reports sizes in kilobytes, while /usr/bin/sum reports sizes in 512-byte blocks, even with the -r option.


Use an alternate checksum algorithm; this produces the same results as the BSD version of sum.


tabs [tabspec] [options]

Set terminal tab stops according to tabspec. The default tabspec, -8, gives the standard Unix tab settings. Specify tabspec as a predefined set of tab stops for particular languages, for example: a (IBM assembler), c (COBOL), f (FORTRAN), p (PL/1), s (SNOBOL), and u (UNIVAC assembler). tabspec can also be a repeated number, arbitrary numbers, or called from a file.


Repeat tab every n columns (e.g., 1+n, 1+2*n, etc.).

Arbitrary ascending values. If n is preceded by +, it is added (i.e., tab is relative to previous position).

1, 10, 16, 36, 72.

1, 10, 16, 40, 72.

1, 8, 12, 16, 20, 55.

1, 6, 10, 14, 49.

1, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 67.

1, 7, 11, 15, 19, 23.

1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61.

1, 10, 55.

1, 12, 20, 44.

Read first line of file for tabs.


Set left margin to n (default is 10).

Set terminal type (default is $TERM).


/usr/ccs/bin/tsort [file]

Perform a topological sort on file. Typically used with lorder to reorganize an archive library for more efficient handling by ar or ld. Not very useful. See also lorder.


Find the ordering relationship of all object files, and sort them for access by ld:

ld -o myprog `lorder *.o | tsort`

unpack files

Expand one or more files, created with pack, to their original form. See pack">pcat and \2.


uucp [options] [source!]file [destination!]file

Copy a file (or group of files) from the source to the destination. The source and destination can be remote systems. The destination file can be a directory.


Do not copy files to the spool directory (the default).

Copy files to the spool directory for transfer.

Make directories for the copy when they don't exist (the default).

Do not make directories when they don't exist.

Set grade (priority) of job. x is typically a single letter or digit, where a and 1 give the highest transfer priority. Use uuglist to show values for x.

Print the uucp job number.

When copy is complete, send mail to person who issued uucp command.

When copy is complete, send mail to (notify) user.

Queue job, but don't start transfer program (uucico).

Send transfer status to file (a full pathname); overrides -m. Solaris accepts but ignores this option for security reasons.

Debug at level n (0–9); higher numbers give more output.


This shell script sends a compressed file to system orca:

$ cat send_it
#! /bin/sh
compress $1
uucp -C -n$2 -m $1.Z orca!/var/spool/uucppublic
uncompress $1

With -C, the transfer is made from a copy in the spool directory. (Normally, uucp gets the file from its original location, so you can't rename it or uncompress it until the call goes through.) The script also notifies the sender and the recipient when the transfer finishes. Here's a sample run:

send_it chapter1 bob

uuglist [option]

List all service grades available for use with the -g option of uux and uucp. Service grades define the priority of data transferral; they are typically expressed as single characters or as a string.


List grades available to the current user.


uulog [options]

Print information from the uucp or uuxqt log files, which reside in /var/uucp/.Log (down subdirectories uucico or uuxqt). See also tail in Chapter 2.


Issue a tail -f to print the most recent actions for a given system.

Print all actions for the given system.

Check the uuxqt log file for the given system (used with -f or -s).

Execute a tail command of n lines (used with -f).


uuname [options]

Print the names of systems uucp knows about.


Print system names known to cu (usually the same).

Print the local system's node name.


uupick [option]

Query the status of files sent to the user with uuto.


Search only for files sent from system.

Interactive Responses

Move all files sent from system to the named dir.

Delete the entry.

Move the file to the directory dir.

Print the file.

Quit uupick.

Print a command summary.

Execute the shell command cmd.

Quit uupick.

Move to next entry.


uustat [options]

Provide information about uucp requests. This command can also be used to cancel uucp requests. Options -a, -j, -k, -m, -p, -q, and -r cannot be used with each other.


Report all queued jobs.

When used with -t, report average time spent on queue instead of average transfer rate.

When used with -t, report averages for past n minutes instead of past hour.

Report the total number of jobs displayed (use only with -a or -s).

Kill job request n; you must own it.

Report accessibility of other systems.

Suppress standard output but not standard error.

Execute a ps -flp on active UUCP processes.

Report the jobs queued for all systems.

Renew job n by issuing a touch on its associated files.

Report the status of jobs for system.

Report status for jobs of type x:


Completed jobs.


Interrupted jobs.


Queued jobs.


Running jobs.

Report system's average transfer rate (in bytes per second) over the past hour.

Report the status of jobs for user.


uuto [options] sourcefiles destination

Send source files to a destination, where destination is of the form system!user. The user on the destination system can pick up the files with uupick.


Send mail when the copy is complete.

Copy files to the spool directory.


uux [options] [[sys]!command]

Gather files from various systems and execute command on the specified machine sys. uux also recognizes the uucp options -c, -C, -g, -r, -s, and -x.


Same as -p (pass standard input to command).

Notify user upon completion (see -z).

Print the standard input when the exit status indicates an error.

Print the uux job number.

Do not send mail if command fails.

Pass the standard input to command.

Notify invoking user upon successful completion.


vacation [options]

SVR4 version for UPAS. (See also vacation in Chapter 2.) Automatically return a mail message to the sender announcing that you are on vacation. To disable this feature, type mail -F "".


Append the date to logfile (see -l).

-F user
Forward mail to user when unable to send mail to mailfile (see -m).

-l logfile
Record in logfile the names of senders who received an automated reply (default is $HOME/.maillog).

-m mailfile
Save received messages in mailfile (default is $HOME/.mailfile).

-M msg_file
Use msg_file as the automatic reply to mail (default is /usr/lib/mail/std_vac_msg).


/usr/ccs/bin/vc [options] [keyword=value ...]

“Version control.” Copy lines from standard input to standard output under control of the vc keywords and arguments within the standard input.

This command is completely unrelated to RCS and to SCCS; it is essentially useless.


Replace control keywords in all lines, including text lines.

Use k instead of : as the control character.

Suppress warning messages.

If any control characters are found before the first tab in the file, remove all characters up to the first tab.


whois [option] name

Search an Internet directory for the person, login, handle, or organization specified by name. Precede name with the modifiers !, ., or *, alone or in combination, to limit the search to either (1) the name of a person or of a username, (2) a handle, or (3) an organization.


-h host
Search on host machine host.


write user [tty]



Initiate or respond to an interactive conversation with user. A write session is terminated with EOF. If the user is logged in to more than one terminal, specify a tty. See also talk in Chapter 2.

Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.