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


Book HomeBook TitleSearch this book

B.2. Alphabetical Summary of Commands

bfs

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.

Option

-
Do not print the file size.

cof2elf

cof2elf [options] files

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

Options

-i
Ignore unrecognized data; do the conversion anyway.

-q
Quiet mode; suppress messages while running.

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

-sdir
Save the original files to an existing directory dir.

-V
Print the version of cof2elf on standard error.

crypt

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

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.

Options

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

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

-C
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.

-d
Print diagnostics.

-e
Send even-parity data to remote system.

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

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

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

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

-n
Prompt user for a telephone number.

-o
Use odd parity (opposite of -e).

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

-t
Dial an ASCII terminal that has auto-answer set.

Destination

telno

The telephone number of the modem to connect to.

system

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

addr

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.

~%cd
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.

~%b
Send a BREAK sequence to the remote system.

~%d
Turn debug mode on or off.

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

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

~%ifc
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).

~%ofc
Set output flow control either on or off.

~%divert
Allow/prevent diversions not specified by ~%take.

~%old
Allow/prevent old-style syntax for diversions received.

Examples

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

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.

Options

-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

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.

Options

-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

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.

Options

-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

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.

Options

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

-s
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

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.

Option

-s
Suppress output and return exit status only.

Example

if ismpx -s
then jwin
fi
jterm

jterm

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.

jwin

jwin

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

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).

Options

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

-D
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).

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

-s
Report protocol statistics on standard error after exiting layers.

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

lorder

/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.

Example

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`
lptest

/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

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.

Options

-s
Suppress name s; show only corresponding mail address.

-v
Verbose mode; show debugging information.

newform

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).

Options

-a[n]
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.

-b[n]
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.

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

-e[n]
Same as -b, but delete from the end.

-f
Display tabspec format used by last -o option.

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

-l[n]
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).

-o'tabspec'
Turn spaces into tabs using tabspec conversion.

-p[n]
Same as -a, but pad beginning of line.

-s
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.

Example

Remove sequence numbers from a COBOL program:

newform -l1 -b7 file
newgrp

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

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.

Options

-a
Print all news items, whether current or not.

-n
Print names of news items, but not their contents.

-s
Report the number of current news items.

notify

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.

Options

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

-n
Disable mail notification. -n is used alone.

-y
Enable mail notification.

openwin

/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:

calctool

On-screen scientific calculator

clock

Clock

cm

Calendar manager

cmdtool

Terminal emulator

iconedit

Icon editor

mailtool

Mail reader

oclock

A round clock

pageview

PostScript viewer

perfmeter

System-performance meter

printtool

Print manager

shelltool

Another terminal emulator (respects stty settings)

snapshot

Saves portions of X display

textedit

Simple text editor

xbiff

Graphical mail arrival watchdog program

xcalc

Simple on-screen calculator

xditview

Device-independent troff output viewer

xedit

Simple text editor

xhost

Controls permissions for who can connect to display

xload

System load monitor

xlock

Screen saver/locker

xmag

Magnifies portions of the display

xman

Viewer for manpages

xterm

Standard X Window system terminal emulator

pack

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.)

Options

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

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

pcat

pcat files

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

pg

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.

Options

-c
Clear screen (same as -c of more).

-e
Do not pause between files.

-f
Do not split long lines.

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

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

-r
Restricted mode; shell escapes aren't allowed.

-s
Display messages in standout mode (reverse video).

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

+num
Begin displaying at line number num.

+/pat
Begin displaying at first line containing pattern pat.

Example

pg -p 'Page %d :' file
red

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

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.

Option

-s
Don't print error messages.

ruptime

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.

Options

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

-l
Sort by load average.

-r
Reverse the sort order.

-t
Sort by up time.

-u
Sort by number of users.

rwho

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.

Option

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

shl

shl

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.

name
Make layer name be the current level.

quit
Exit shl and kill all the layers.

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

toggle
Flip back to the previous layer.

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

sum

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.

Option

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

tabs

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.

Tabspec

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

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

-a
1, 10, 16, 36, 72.

-a2
1, 10, 16, 40, 72.

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

-c2
1, 6, 10, 14, 49.

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

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

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

-s
1, 10, 55.

-u
1, 12, 20, 44.

--file
Read first line of file for tabs.

Options

+mn
Set left margin to n (default is 10).

-Ttype
Set terminal type (default is $TERM).

tsort

/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.

Example

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

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

unpack files

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

uucp

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.

Options

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

-C
Copy files to the spool directory for transfer.

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

-f
Do not make directories when they don't exist.

-gx
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.

-j
Print the uucp job number.

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

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

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

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

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

Example

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

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.

Option

-u
List grades available to the current user.

uulog

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.

Options

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

-ssys
Print all actions for the given system.

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

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

uuname

uuname [options]

Print the names of systems uucp knows about.

Options

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

-l
Print the local system's node name.

uupick

uupick [option]

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

Option

-ssystem
Search only for files sent from system.

Interactive Responses

a[dir]
Move all files sent from system to the named dir.

d
Delete the entry.

m[dir]
Move the file to the directory dir.

p
Print the file.

q
Quit uupick.

*
Print a command summary.

!cmd
Execute the shell command cmd.

EOF
Quit uupick.

RETURN
Move to next entry.

uustat

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.

Options

-a
Report all queued jobs.

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

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

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

-kn
Kill job request n; you must own it.

-m
Report accessibility of other systems.

-n
Suppress standard output but not standard error.

-p
Execute a ps -flp on active UUCP processes.

-q
Report the jobs queued for all systems.

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

-ssystem
Report the status of jobs for system.

-Sx
Report status for jobs of type x:

c

Completed jobs.

i

Interrupted jobs.

q

Queued jobs.

r

Running jobs.

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

-uuser
Report the status of jobs for user.

uuto

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.

Options

-m
Send mail when the copy is complete.

-p
Copy files to the spool directory.

uux

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.

Options

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

-auser
Notify user upon completion (see -z).

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

-j
Print the uux job number.

-n
Do not send mail if command fails.

-p
Pass the standard input to command.

-z
Notify invoking user upon successful completion.

vacation

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 "".

Options

-d
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).

vc

/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.

Options

-a
Replace control keywords in all lines, including text lines.

-ck
Use k instead of : as the control character.

-s
Suppress warning messages.

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

whois

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.

Option

-h host
Search on host machine host.

write

write user [tty]

message

EOF

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.