0% found this document useful (0 votes)
11 views

Appendix C

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Appendix C

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

AFZAMA03_0131194496.

qxd 3/16/07 2:20 PM Page 509

Command Summary
The following is a list of the UNIX commands (utilities) in alphabetic order. The num-
bers after the commands are the page numbers. To refresh your memory, the command
line format is shown again in Figure C.1.

Figure C.1
The Command Line Format
$ command [ - options ] [ arguments ]

Generally filenames or pathnames

One or more single-letter options

The minus sign, indicating that this is an option

The command name

The system prompt

alias . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
This creates aliases for commands.

at . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
This command runs another command or a list of commands at a later time.

Option Operation

-l Lists all jobs that are submitted with at.


-m Mails you a short message of confirmation at completion of the job.
-r Removes the specified job numbers from the queue of jobs scheduled by at.

banner. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
This command displays its argument, the specified string, in large letters.

509
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 510

510 Appendix C

cal. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Displays the calendar for a specified year or month of a year.

calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
This command is a reminder service and reads your schedule from the calendar file in the
current directory.

cancel (cancel print requests). . . . . . . . . . . . . . . . . . . . . . . . . . . . 113


You can use this command to cancel print requests that are in queue waiting to be printed or
are currently being printed.

cat (concatenate). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109


This concatenates/displays file(s).

cd (change directory) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
This command changes your current directory to another directory.

chmod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
This command changes the access permission of a specified file according to the option let-
ters indicating different categories of users. The user categories are u (for user/owner), g (for
group), o (for others), and a (for all). The access categories are r (for read), w (for write),
and x (for executable).

compress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
This command is used to compress the specified file, thus reducing the size of the file and
saving space. The uncompress command is used to recover the original file and remove the
compressed file.

cp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
This command copies file(s) within the current directory or from one directory to another.

Option Operation

UNIX Linux Alternative

-b --backup Makes a backup of the specified file if file already exists.


-i --interactive Asks for confirmation if the target file already exists.
-r --recursive Copies directories to a new directory.
--verbose Explain what is being done.
--help Displays the help page and exits.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 511

Command Summary 511

crypt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 478
This command is used to encrypt and decrypt a file. The command changes each character
in your file in a reversible way, so you can obtain the original file later.

cut . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 244
This command is used to “cut out” specific columns or fields from a file.

Option Operation

UNIX Linux Alternative

-f --fields Specifies the field position.


-c --characters Specifies the character position.
-d --delimiter Specifies the field separator (delimiter) character.
--help Displays the help page and exits.

--version Displays the version information and exits.

date . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Displays the day of the week, month, date, and time.

df . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 459
This command reports the total amount of the disk space or the space available on a
specified file system.

(dot) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371
This command lets you run a process in the current shell environment and does not allow the
shell to create a child process to run the command.

du . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 460
This command summarizes the total space occupied by any directory, its subdirectories, or
each file.

Option Operation

UNIX Linux Alternative

-a --all Display the size of directories and files.


-b --bytes Displays the size of directories and files in bytes.
-s -- summarize Displays only the total blocks for the specified directory;
subdirectories are not listed.
--help Displays a usage message.

--version Displays the version information.


AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 512

512 Appendix C

echo. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269
This command displays (echoes) its arguments on the output device.
Escape
Character Meaning

\a Audible alert (bell)


\b Backspace
\c Inhibit the terminating newline
\f Form feed
\n Carriage return and a line feed (newline)
\r Carriage return without the line feed
\t Horizontal tab
\v Vertical tab

exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 370
This command terminates the current shell program whenever it is executed. It can also
return a status code (RC) to indicate the success or failure of a program. It also terminates
your login shell and logs you off if it is typed at the $ prompt.

export . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
This command makes a specified list of variables available to other shells.

expr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
This command is a built-in operator for arithmetic operations. It provides arithmetic and
relational operators.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 513

Command Summary 513

find . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
This command locates files that match a given criterion in a hierarchy of directories. With
the action options, you can instruct UNIX about what to do with the files once they are
found.

Search Option Description

-name filename Finds files with the given filename.


size + n Finds files with the size n.
-type file type Finds files with the specified access mode.
-atime + n Finds files that were accessed n days ago.
-mtime + n Finds files that were modified n days ago.
-newer filename Finds files that were modified more recently than filename.

Action Option Description

-print Prints the pathname for each file found.


-exec command\; Lets you give commands to be applied to the files.

-ok command\; Asks for confirmation before applying the command.

finger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
This command displays detailed information on users.

Option Operation

-b Suppresses displaying of the user’s HOME directory and shell in a long format dis-
play.
-f Suppresses displaying the header in a nonlong format output.
-h Suppresses displaying the .project file in a long format output.
-l Forces long format output.
-p Suppresses displaying the .plan file in a long format output.
-s Forces short format output.

FTP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
This command (utility) is used to transfer files from one system to another. Files of any type
can be transferred, and you can specify whether the file is an ASCII or a binary file. You
type ftp to start an FTP session.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 514

514 Appendix C

FTP access commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480


Command Description

open remote-hostname Opens a connection to the FTP server on the specified host. It
prompts you to enter the user name and password to log in on the
remote host.
close Closes current open connection and returns to the local FTP
command. At this point you may issue the open command for a
different remote host.
quit (bye) Closes the current FTP session with the remote server and exits
ftp. That is, it returns to UNIX shell level.

FTP file and directory commands . . . . . . . . . . . . . . . . . . . . . . . . . 480


Command Description

cd remote-directory-name Changes the current directory on the remote host to the


specified directory.
lcd local-directory-name Changes the current directory on the local host to the
specified directory.
dir Lists the current directory on the remote host.
pwd Prints the name of the current directory on the remote
host.
mkdir remote-directory-name Makes a new directory on the remote host. Typically, you
must have permission to do this.
delete remote-filename Deletes a single specified file on the remote host.
mdelete remote-filenames Deletes multiple files on the remote host.

FTP miscellaneous commands . . . . . . . . . . . . . . . . . . . . . . . . . 482


Command Description

? or help Displays an informative message about the meaning of the specified com-
mand. If no argument is given, a list of the known commands is displayed.
! Switches to escape shell mode.
hash Displays hash sign (#) as feedback for each data block transferred. The size of
a data block is 8192 bytes.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 515

Command Summary 515

grep (Global Regular Expression Print) . . . . . . . . . . . . . . . . . . . 288


Searches for a specified pattern in file(s). If the specified pattern is found, the line
containing the pattern is displayed on your terminal.

Option Operation

UNIX Linux Alternative

-c --count Displays only the count of the matching lines in each file
that contains the match.
-i --ignore-case Ignores the distinction between lower and uppercase letters
in the search pattern.
-l --files-with-matches Displays the names of the files with one or more matching
lines, not the lines themselves.
-n --line-number Displays a line number before each output line.
-v --revert-match Displays only those lines that do not match the pattern.
--help Displays help page and exits.
--version Displays version information and exits.

head. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
This command displays the first part of a specified file. This is a quick way to check the
contents of a file. The number of lines to be displayed is an option, and more than one file
can be specified on the command line.

Option Operation

UNIX Linux Alternative

-l --lines Counts by lines. This is the default option.


-c --chars=num Counts by characters.
--help Displays the help page and exits.
--version Displays the version information and exits.

help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Brings to the display a series of menus and questions that lead you to the descriptions of the
most commonly used UNIX commands.

history (ksh) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 300


This command is a Korn and Bourne Again shell feature that keeps a list of all the com-
mands you enter during your sessions.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 516

516 Appendix C

kill . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Terminates an unwanted or unruly process. You have to specify the process ID number. The
process ID0 kills all programs associated with your terminal.

learn. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
A computer-aided instruction program that is arranged in a series of courses and lessons.
It displays the menu of courses and lets you select your desired course and lesson.

let . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
This command provides arithmetic operations.

ln . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 229
Creates links between an existing file and another filename or directory. It lets you have
more than one name for a file.

lp (line printer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110


This prints (provides hard copy of) the specified file.

Option Operation

-d Prints on a specific printer.


-m Sends mail to the user mailbox after completion of the print request.
-n Prints specified number of copies of the file.
-s Suppresses feedback messages.

lpr (line printer) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113


This command prints the specified file. lpr reads from the standard input if no filename is
specified.

Option Operation

-p Prints on a specific (named) printer.


-# Prints specified number of copies of the file.
-T Prints a specified title on the banner page of the output.
-m Sends mail to the user mailbox after completion of the print request.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 517

Command Summary 517

lpstat (line printer status) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114


This provides information about your printing request jobs, including printing a request ID
number that you can use to cancel a printing request.

Option Operation

-d Prints the name of the system default printer for print requests.

ls (list) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
This command lists the contents of your current directory, or any directory you specify.

Option Operation

UNIX Linux Alternative

-a --all Lists all files, including the hidden files.


-C -- format=vertical Lists files in multicolumn format. Entries are sorted
-- format=horizontal down the columns.
-F --classify Places a forward slash (/) after each filename
if that file is a directory, and an asterisk (*)
if it is an executable file.
-l --format=single-column Lists files in a long format, showing detailed
information about the files.
-m --format=commas Lists files across the page, separated by commas.
-p Places a forward slash (/) after each filename
if that file is a directory.
-r --reverse Lists files in reverse alphabetical order.
-R --recursive Recursively lists the contents of the directory.
-s --size Show size of each file in blocks.
-x --format=horizontal Lists files in multicolumn format. Entries are sorted
--format=across across the line.
--help Displays a usage message.

mailx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
This utility provides the electronic mail system for the users. You can send messages to
other users on the system, regardless of whether they are logged on or not.

Option Operation

-f filename Reads mail from the specified filename instead of the system mailbox. If no
file is specified, it reads from mbox.
-H Displays a list of the message headers.
-s subject Sets the subject field to the string subject.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 518

518 Appendix C

mailx command mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339


When you invoke mailx to read your mail, it places itself in command mode. The prompt
for this mode is the question mark (?).

Command Operation

! Lets you execute the shell commands (the shell escape).


cd directory Changes to the specified directory, or to the HOME directory if none is speci-
fied.
d Deletes the specified messages.
f Displays the headlines of the current message.
q Exits mailx and removes the messages from the system mailbox.
h Displays active message headers.
m users Sends mail to specified users.
R messages Replies to the sender of the messages.
r messages Replies to the sender of the messages and all the other recipients of the same
messages.
s filename Saves (appends) the indicated messages to the file named filename.
t messages Displays (types) the specified messages.
u messages Undeletes the specified messages.
x Exits mailx does not remove messages from the system mailbox.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 519

Command Summary 519

mailx tilde escape commands . . . . . . . . . . . . . . . . . . . . . . . . . 326


When you invoke mailx to send mail to others, it places itself in input mode, ready for you
to compose your message. The commands in this mode start with a tilde (~) and are called
tilde escape commands.

Command Operation

~? Displays a list of all the tilde escape commands.


~! command Lets you invoke the specified shell command while composing your message.
~e Invokes an editor for editing your message. The editor to be used is defined
in the mail variable called EDITOR.
~q Quits input mode. Saves your partially composed message is saved in the
file called dead.letter.
~r filename Reads the file named filename and adds its contents to your message.
~< filename Reads the file named filename (using the redirection operator) and adds its
contents to your message.
~<! command Executes the specified command and places its output into your message.
~v Invokes the default visual editor, the vi editor, or uses the value of the mail
variable VISUAL, which can be set up for other editors.
~w filename Writes the message currently being composed to the specified filename.

man . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
This command shows pages from the online system documentation.

mesg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 320
This command is set to n to prohibit unwanted write messages. It is set to y to receive
messages.

mkdir (make directory) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94


This command creates a new directory in your working directory, or in any other directory
you specify.

Option Operation

-p Lets you create levels of directories in a single command line.


AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 520

520 Appendix C

more. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Displays files one screen at a time. This is useful for reading large files.

Option Operation

UNIX Linux Alternative

-lines -num lines Displays the indicated number of lines per


screen.
+line-number Starts up at line-number.
+/pattern Starts two lines above the line containing the pattern.
-c -p Clears the screen before displaying each page
instead of scrolling. This is sometimes faster.
-d Displays the prompt [Hit space to continue,
Del to abort].
-- help Displays the help page and exits.

mv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
This command renames files or moves files from one location to another.

Option Operation

UNIX Linux Alternative

-b --backup Makes backup of the specified file if file already exists.


-i --interactive Asks for confirmation if the target file already exists.
-f --force Removes target file if file already exists and does not
ask for confirmation.
-v --verbose Explains what is being done.
--help Displays the help page and exits.
--version Displays version information and exits.

news . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 321
This command is used to look at the latest news in the system. It is used by the system
administrator to inform others of the events happening.

Option Operation

-a Displays all the news items, whether they are in old or new files.
-n Lists only the names of the news files (headers).
-s Displays the number of the current news items.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 521

Command Summary 521

nohup. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
This prevents the termination of the background process when you log out.

passwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
This command changes your login password.

paste . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
This command is used to join files together line by line, or to create new files by pasting
together fields from two or more files.

Option Operation

UNIX Linux Alternative

-d --delimiters Specifies the field separator (delimiter) character.


--help Displays the help page and exits.
--version Displays the version information and exits.

pg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Displays files one screen at a time. You can enter the options or other commands when pg
shows the prompt sign.

Option Operation

-n Does not require [Return] to complete the single-letter commands.


-s Displays messages and prompts in reverse video.
-num Sets the number of lines per screen to the integer num. The default value is 23
lines.
-pstr Changes the prompt : (colon) to the string specified as str.
+line-num Starts displaying the file from the line specified in line–num.
+/pattern Starts viewing at the line containing the first occurrence of the specified
pattern.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 522

522 Appendix C

The pg Command Key Operators . . . . . . . . . . . . . . . . . . . . . . . 212


These keys are used when pg displays the prompt sign.

Key Operation

+n Advances n screens, where n is an integer number.


-n Backs up n screens, where n is an integer number.
+nl Advances n lines, where n is an integer number.
-nl Backs up n lines, where n is an integer number.
n Goes to screen n, where n is an integer number.

pr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
Your file is formatted before printing or viewing it on the screen.

Option Operation

UNIX Linux Alternative

+page --pages=page Starts displaying from the specified page. The de-
fault is page 1.
-columns --columns=columns Displays output in the specified number of
columns. The default is one column.
-a --across Displays output in columns across (rather than
down) the page, one line per column.
-d --double-space Displays output double spaced.
-hstring --header=string Replaces the filename in the header with the speci-
fied string.
-lnumber --length=number Sets the page length to the specified number of
lines. The default is 66 lines.
-m --merge Displays all the specified files in multiple columns.
-p Pauses at the end of each page and sounds the bell.
-character --separator=character Separates columns with a single specified
character. If character is not specified, then [Tab]
is used.
-t --omit-header Suppresses the five-line header and five-line trailer.
-wnumber --width=number Sets line width to the specified number of
characters. The default is 72.
--help Displays help page and exits.
--version Displays version information and exits.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 523

Command Summary 523

ps (process status) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283


This command displays the process ID of the programs associated with your terminal.

Option Operation

-a Displays the status of all the active processes, not just the user’s.
-f Displays a full list of information, including the full command line.

pwd (print working directory) . . . . . . . . . . . . . . . . . . . . . . . . . . 92


This command displays the pathname of your working directory or any other directory you
specify.

r (redo) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
This is a Korn shell command that repeats the last command or commands from the history
file.

read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 372
This command reads input from the input device and stores the input string in one or more
variables specified as the command arguments.

remote computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490


UNIX provides a set of commands that allow you to log into a remote server and act as
though you were physically connected to that server and all its resources.

Command Operation

rcp Remote copy program


rsh Remote shell program
rlogin Remote login program

rm (remove) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
This command removes (deletes) files from your current directory, or any other directory
you specify.

Option Operation

UNIX Linux Alternative

-i --interactive Asks for confirmation before deleting any file.


-r --recursive Deletes the specified directory and every file and subdirec-
tory in it.
--help Displays a usage message.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 524

524 Appendix C

rmdir (remove directory) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98


This command deletes the specified directory. The directory must be empty.

set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Displays the environmental/shell variables on the output device. The command unset
removes the unwanted variables.

sh, ksh, or bash . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364


This command invokes a new copy of the shell. You can run your script files using this
command. Only three of the numerous options are mentioned.

Option Operation

-n Reads commands but does not execute them.


-v Prints the input to the shell as the shell reads it.
-x Prints command lines and their arguments as they are executed. This option is
used mostly for debugging.

sleep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
This command causes the process to go to sleep (wait) for the specified time in seconds.

sort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Text file(s) are sorted in different orders.

Option Operation

-b Ignores leading blanks.


-d Uses dictionary order for sorting. Ignores punctuation and control characters.
-f Ignores the distinction between lowercase and uppercase letters.
-n Numbers are sorted by their arithmetic values.
-o Stores the output in a specified file.
-r Reverses the order of the sort from ascending to descending.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 525

Command Summary 525

spell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
This command checks the spelling of a specified document or words entered from the
keyboard. It only displays the words not found in the spelling list and does not suggest a
correct spelling.

Option Operation

-b Checks with British spelling.


-v Displays the words that are not in the spelling list and their derivation.
-x Displays plausible stems for each word being checked.

stty . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
This command sets options that control the capabilities of your terminal. There are more
than a hundred different settings, and the following table lists only some of the options.

Option Operation

echo [-echo] Echoes [does not echo] the typed characters; the default is echo.
raw [-raw] Disables [enables] the special meaning of the metacharacters; the default is
-raw.
intr Generates an interrupt signal; usually the [Del] key is used.
erase [Backspace]. Erases the preceding character; usually the # key is used.
kill Deletes the entire line; usually @ or [Ctrl-u] is used.
eof Generates the (end-of-file) signal from the terminal; usually [Ctrl-d] is used.
ek Resets the erase and kill keys to # and @, respectively.
sane Sets the terminal characteristics to sensible default values.

tail . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
This command displays the last part (tail end) of a specified file. This is a quick way to
check the contents of a file. The options give the flexibility to specify a desired part of
the file.

Option Operation

UNIX Linux Alternative

-l --lines Counts by lines. This is the default option.


-c --chars=num Counts by characters.
--help Displays the help page and exits.
--version Displays the version information and exits.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 526

526 Appendix C

talk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
This command is used for terminal-to-teminal communication. The receiving party must be
logged on.

tar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
This command is used to copy a set of files into a single file, called a tarfile. A tarfile
is usually saved on a magnetic tape but it can be on any other media such as a floppy disk.
It packs multiple files into a single file (in tar-format) that can be unpacked later by tar.

Option Operation

UNIX Linux Alternative

-c --create (create) Creates a new tarfile. Writing begins at the


beginning of the tarfile.
-f --file (file) Uses the next argument as a place where the archive is
to be placed.
-r --concatenate (replace) Writes a new archive at the end of the tarfile.
-t --list (table of contents) Lists the name of the files in the
tarfile.

-x --extract or --get (extract) Extracts files from the tarfile.


-v --verbose (verbose) Provides additional information about the
tarfile entries.

--help Displays a usage message.


--version Displays the version information.

tee . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
The output is split. One copy is displayed on your terminal, the output device, and another
copy is saved in a file.

Option Operation

-a Appends output to a file without overwriting an existing file.


-i Ignores interrupts; does not respond to the interrupt signals.

telnet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
This command allows you to log into a remote server using server resources such as such as
a scanner, CD storage devices, or a CD-writer. Also, it allows you to access your account on
a UNIX server from your system at home.

test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 384
This command tests the condition of an expression given to it as an argument, and returns
true or false depending on the status of the expression. It gives you the capability of testing
different types of expressions.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 527

Command Summary 527

time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
This command provides information about the computer time your command uses. It reports
the real time, user time, and system time required by a specified command.

tput . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
This command is used with the terminfo database, which contains codes for terminal
characteristics and facilitates the manipulation of your terminal characteristics such as
boldface text, clear screen, and so on.

Option Operation

bel Echoes the terminal’s bell character.


blink Makes a blinking display.
bold Makes a boldface display.
clear Clears the screen.
cup r c Moves cursor to row r and column c.
dim Dims the display.
ed Clears from the cursor position to the end of the screen.
el Clears from the cursor position to the end of the line.
smso Starts stand out mode.
rmso Ends stand out mode.
smul Starts underline mode.
rmul Ends underline mode.
rev Shows reverse video, black on white display.
sgr0 Turns off all the attributes.

trap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
This command sets and resets the interrupt signals. The following table shows some of the
signals you can use to control the termination of your program.

Signal
Number Name Meaning

1 hang up Terminal connection is lost.


2 interrupt One of the interrupt keys has been pressed.
3 quit One of the quit keys has been pressed.
9 kill The kill -9 command has been issued.
15 terminator The kill command has been issued.
AFZAMA03_0131194496.qxd 3/16/07 2:20 PM Page 528

528 Appendix C

type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
This command gives more information about another command, such as whether the speci-
fied command is a shell command or a shell built-in command.

wall . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322
This command is used mostly by the system administrator to warn users of some imminent
events.

wc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 232
This command counts number of characters, words, or lines in the specified file.

Option Operation

UNIX Linux Alternative

-l --lines Reports the number of lines.


-w --words Reports the number of words.
-c --chars Reports the number of characters.
--help Displays the help page and exits.
--version Displays version information and exits.

who . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Lists the login name, terminal lines, and login times of the users who are on the system.

Option Linux Operation

-q --count The quick who; just displays the name and number of users.
-H --heading Displays heading above each column.
-b Displays the time and date of the last reboot.
--help Displays a usage message.

write . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
This command is used for terminal-to-terminal communication. The receiving party must be
logged on.

You might also like