UNIX Quick Reference Guide

How to Use This Guide

This guide is best used as a quick reference for commands. If you need more information on the command, refer to the on-line manual.

Logging On and Logging Off

NAME

exit - close terminal session

SYNOPSIS

exit

DESCRIPTION

It is important to log off when you finish your work so that other people can use the terminal an also so that nobody else can misuse your account. To close a terminal session simply type exit on the command line. It not necessarily terminates all of your running jobs. To finish your work session you must click on the exit bottom of the LogOff window. It safely terminates all of your running jobs and resets the x-terminal.

NAME

passwd - change login password and password attributes

SYNOPSIS

passwd [ name ]

DESCRIPTION

The passwd command changes the password or lists password attributes associated with the user's login name.

NAME

tn - telnet terminal emulation for PC

SYNOPSIS

tn hostname

DESCRIPTION

tn is a vt220 terminal emulation for PC running PCTCP network software.

NAME

xt - local telnet session terminal emulator for X-terminal

SYNOPSIS

xt [hostname]

DESCRIPTION

xt opens a new local telnet session on the x-terminal. It provides VT220 compatible terminal emulation. If hostname is not specified then the host with least cpu load is taken from the cluster {alfa, beta, gamma, delta}.

Getting On-Line Help

NAME

man - display reference manual pages

SYNOPSIS

man title

DESCRIPTION

The man command displays information from the reference manuals. It can display complete manual pages that you select by title.

NAME

xman - Manual page display program for the X Window System

SYNOPSIS

xman [-options ...]

DESCRIPTION

Xman is a manual page browser. The default size of the initial xman window is small so that you can leave it running throughout your entire login session. In the initial window there are three options: Help will pop up a window with on-line help, Quit will exit, and Manual Page will pop up a window with a manual page browser in it. Typing Control-S will pop up a window prompting for a specific manual page to display. You may display more than one manual page browser window at a time from a single execution of xman.

Manipulating Files and Directories

NAME

cat - concatenate and print files

SYNOPSIS

cat file...

DESCRIPTION

cat reads each file in sequence and writes it on the standard output.

NAME

cd - change working directory

SYNOPSIS

cd [ directory ]

DESCRIPTION

directory becomes the new working directory.

NAME

chmod - change file mode

SYNOPSIS

chmod [ugoa ]{+ |- |=}[ rwx ] file ...

DESCRIPTION

Options:

Who:Op-codes:Permission:

u user's permissions+ Add permissionsr read

g group's permissions- Take away permissionsw write

o other's permissions= Assign permissions absolutelyx execute

a all permissions

There is a shorthand way of setting permissions by using three digit octal numbers, one digit for user, group and other respectively in this order. Read permission is geven the value 4, write permission the value 2 and execute permission 1. The values are added together for any one user category.

u user's permissions+ Add permissionsr read

g group's permissions- Take away permissionsw write

o other's permissions= Assign permissions absolutelyx execute

a all permissions

There is a shorthand way of setting permissions by using three digit octal numbers, one digit for user, group and other respectively in this order. Read permission is geven the value 4, write permission the value 2 and execute permission 1. The values are added together for any one user category.

NAME

cp - copy files

SYNOPSIS

cp [-i] [-p] f1 f2

cp [-i] [-p] f1 ... fn d1

cp [-i] [-p] [-r] d1 d2

DESCRIPTION

The cp command copies files to target.

Options:

-i prompt for confirmation.

-r copy the directory and all its files.

-p preserves the modification time and permission modes.

NAME

find - find files

SYNOPSIS

find pathname searchcriteria action(s)

DESCRIPTION

Search Criteria:

- name patternFiles match pattern.

-size n Files of size n blocks.

-atime nFiles accessed n days ago.

-mtime nFiles modified n days ago.

Actions:

-printPrint the pathname of the found files.

-exec command Execute the given command upon finding a file; { } represents the found file.

NAME

grep - search a file for a pattern

SYNOPSIS

grep [options] pattern [file ...]

DESCRIPTION

Options:

-c Print only a count of matching lines.

-i Ignore upper/lower case distinction.

-n Precede each line by its line number.

-v Print all lines except those that contain the pattern.

NAME

head - display first few lines of files

SYNOPSIS

head [-n] file

DESCRIPTION

head copies the first n lines of file to the standard output.

NAME

ls - list contents of directory

SYNOPSIS

ls [options] [file . . . ]

DESCRIPTION

For each directory argument, ls lists the contents of the directory; for each file argument, ls repeats its name and any other information requested.

Options:

-R Recursively list subdirectories encountered.

-a List all entries, including those that begin with a dot (.), which are normally not listed.

-l List in long format, giving mode, number of links, owner, group, size in bytes, and time of last modification for each file.

NAME

mkdir - make directories

SYNOPSIS

mkdir dirname ...

DESCRIPTION

mkdir creates the named directories in mode 777 (possibly altered by umask(1)).

NAME

more - view text file one screenful at a time

SYNOPSIS

more [options] file ...

DESCRIPTION

more scrolls up to display one more line in response to a RETURN character; it displays another screenful in response to a SPACE character. See on-line manual for many options.

NAME

mv - move files

SYNOPSIS

mv [-i] f1 f2

mv [-i] f1 ... fn d1

mv [-i] d1 d2

DESCRIPTION

The mv command moves filen to target.

Option:

-i mv will prompt for confirmation on existing target.

NAME

pwd - working directory name

SYNOPSIS

pwd

DESCRIPTION

pwd prints the path name of the working (current) directory.

NAME

rm, rmdir - remove files or directories

SYNOPSIS

rm [-i] file ...

rm -r dirname ... [file ...]

rmdir dirname ...

DESCRIPTION

rm removes the entries of files from a directory.

Options:

-i With this option, confirmation of removal of any write-protected file occurs interactively.

-r This option causes the recursive removal of any directories and subdirectories in the argument list.

NAME

tail - deliver the last part of a file

SYNOPSIS

tail [{-|+}number] [ file ]

DESCRIPTION

tail copies the named file to the standard output beginning at a designated place. Copying begins at distance +number from the beginning, or -number from the end of the input.

NAME

wc - word count

SYNOPSIS

wc [-lwc] [names]

DESCRIPTION

wc counts lines, words, and characters in the named files.

Redirection and Pipeline

OPERATOR

< - redirecting standard input from file

SYNOPSIS

command < file

DESCRIPTION

Standard input is taken from the specified file.

OPERATOR

> - redirecting standard output to the specified file.

SYNOPSIS

command > file

DESCRIPTION

Standard output is written to the specified file.

OPERATOR

> > - redirecting standard output to file

SYNOPSIS

command > > file

DESCRIPTION

Standard output is appended to the end of the specified file.

OPERATOR

| - pipeline of commands

SYNOPSIS

command1 | command2

DESCRIPTION

Standard output of the command1 is used as the standard input of command2.

Text Processing

NAME

emacs - GNU project Emacs

SYNOPSIS

emacs [ command-line switches ] [ files ... ]

DESCRIPTION

GNU Emacs is a new version of Emacs, written by the author of the original (PDP-10) Emacs, Richard Stallman. Its user functionality encompasses everything other Emacs editors do, and it is easily extensible since its editing commands are written in Lisp.

NAME

xedit - simple text editor for X

SYNTAX

xedit [ -toolkitoption ... ] [ filename ]

DESCRIPTION

Xedit provides a window consisting of the four areas:

Commands Section

set of commands that allow you to exit xedit, save the file, or load a new file into the edit window.

Message Window

Displays xedit messages. In addition, this window can be used as a scratch pad.

Filename Display

Displays the name of the file currently being edited, and whether this file is Read-Write or Read Only.

Edit Window

Displays the text of the file that you are editing or creating.

The following keystroke combinations are defined:

Ctrl-a Beginning Of LineMeta-b Backward Word

Ctrl-b Backward CharacterMeta-f Forward Word

Ctrl-d Delete Next CharacterMeta-iInsert File

Ctrl-e End Of LineMeta-k Kill To End Of Paragraph

Ctrl-f Forward CharacterMeta-q Form Paragraph

Ctrl-g Multiply Reset Meta-vPrevious Page

Ctrl-h Delete Previous Character Meta-yInsert Current Selection

Ctrl-j Newline And Indent Meta-z Scroll One Line Down

Ctrl-k Kill To End Of Line Meta-d Delete Next Word

Ctrl-l Redraw Display Meta-DKill Word

Ctrl-m Newline Meta-h Delete Previous Word

Ctrl-n Next Line Meta-H Backward Kill Word

Ctrl-o Newline And Backup Meta-< Beginning Of File

Ctrl-p Previous Line Meta-> End Of File

Ctrl-r Search/Replace Backward Meta-]Forward Paragraph

Ctrl-s Search/Replace Forward Meta-[Backward Paragraph

Ctrl-t Transpose Characters

Ctrl-u Multiply by 4 Meta-Delete Delete Previous Word

Ctrl-v Next Page Meta-Shift DeleteKill Previous Word

Ctrl-w Kill Selection Meta-Backspace Delete Previous Word

Ctrl-y Unkill Meta-Shift BackspaceKill Previous Word

Ctrl-z Scroll One Line Up

In addition, the pointer may be used to cut and paste text:

Button 1 Down Start Selection

Button 1 Motion Adjust Selection

Button 1 Up End Selection (cut)

Button 2 Down Insert Current Selection (paste)

Button 3 Down Extend Current Selection

Button 3 Motion Adjust Selection

Button 3 Up End Selection (cut)

NAME

vi - screen-oriented (visual) display editor

SYNOPSIS

vi file...

DESCRIPTION

vi (visual) is a display-oriented text editor based on an underlying line editor ex. It is possible to use the command mode of ex from within vi and vice-versa. The visual commands are described on vi manual page.

Printing

NAME

lp - send requests to an LP print service

SYNOPSIS

lp [-d destination] files

DESCRIPTION

If destination is not specified then the print request is sent to the default printer fuji (Fujitsu line printer).

Communication

NAME

finger - display information about local and remote users

SYNOPSIS

finger [username]

finger [username]][@hostname

DESCRIPTION

By default, the finger command displays information about each , logged-in user, including login name, full name, terminal name,idle time, login time, and location if known.

NAME

mail - read mail or send mail to users

SYNOPSIS

Sending mail:

mail recipient ...

Reading mail:

mail

Forwarding mail:

mail -F recipient ...

DESCRIPTION

A recipient is usually a user name recognized by login(1). When recipients are named, mail assumes a message is being sent. It reads from the standard input up to an end-of-file (CTRL-d) or, if reading from a terminal device, until it reads a line consisting of just a period.

NAME

mailx - interactive message processing system

SYNOPSIS

Sending mail:

mailx recipient ...

Reading mail:

mailx

DESCRIPTION

The command mailx provides a comfortable, flexible environment for sending and receiving messages electronically. When reading mail, mailx provides commands to facilitate saving, deleting, and responding to messages. When sending mail, mailx allows editing, reviewing and other modification of the message as it is entered. See the man page for the commands.

NAME

talk - talk to another user

SYNOPSIS

talk username[@hostname]

DESCRIPTION

talk is a visual communication program that copies lines from your terminal to that of a user on the same or on another host. username is that user's login name. To exit, just type your interrupt character (<Delete>).

NAME

xtalk - talk to another user

SYNOPSIS

xtalk [username[@hostname]]

DESCRIPTION

Xtalk is a X11 implementation of 4.3 BSD talk. If you don't specify any arguments, a dialogue box will appear where you can enter the person parameters.

NAME

xmessage - display a message or query in a window (X-based /bin/echo)

SYNOPSIS

xmessage -display xtermname:0

xmessage -display xtermname:0 -file filename

DESCRIPTION

Xmessage displays a window containing a message from the command line, a file, or standard input.

NAME

xmh - send and read mail with an X interface

SYNOPSIS

xmh

DESCRIPTION

The xmh program provides a graphical user interface to the MH Message Handling System. Electronic mail messages may be composed, sent, received, replied to, forwarded, sorted, and stored in folders.

NAME

who - give information about current logged on local users

SYNOPSIS

who

Process Handling

NAME

jobs - list stopped and background jobs

SYNOPSIS

jobs [-l]

DESCRIPTION

jobs -l give long listing that includes process identification number (PID).

NAME

kill - terminate jobs

SYNOPSIS

kill [-signal] pid

DESCRIPTION

kill sends a signal to the specified processes. The value of signal may be numeric or symbolic [see signal(5)]. Without signal kill terminates the specified job.

NAME

nice - run a command at low priority

SYNOPSIS

nice command

DESCRIPTION

nice executes command with a lower CPU scheduling priority.

NAME

ps - report process status

SYNOPSIS

ps [-aefl]

DESCRIPTION

ps prints information about active processes. Without options, ps prints information about processes associated with the controlling terminal. The output contains only the process ID, terminal identifier, cumulative execution time, and the command name. Otherwise, the information displayed is controlled by the options.

Options:

-e Prints information about every process now executing.

-a Prints information about all processes most frequently requested.

-f Generates a full listing.

-l Generates a long listing.

Information Systems

NAME

gopher - connect to gopher document server

SYNOPSIS

gopher [hostname [port]]

DESCRIPTION

The gopher client is used to talk to gopher servers.The Internet Gopher is a distributed document delivery service. It allows a neophyte user to access various types of data residing on multiple hosts in a seamless fashion. This is accomplished by presenting the user a hierarchical arrangement of documents and by using a client-server communications model. The Internet Gopher Server accepts simple queries, and responds by sending the client a document.

NAME

info - GNU's hypertext system

SYNOPSIS

info [menu-item...]

DESCRIPTION

The GNU project has a hypertext system called Info which allows the same source file to be either printed as a paper manual, or viewed using info.

Examples: info gcc

NAME

Mosaic - a Motif based World Wide Web browser.

SYNOPSIS

M&

DESCRIPTION

NCSA Mosaic is a networked information discovery, retrieval, and collaboration tool and World Wide Web browser developed at the National Center for Supercomputing Applications. In other words, Mosaic is an interface to the Internet.

Think before click!!!

NAME

xarchie - X11 browser interface to archie

SYNOPSIS

xarchie [-host host]

DESCRIPTION

Xarchie is an X11 browser interface to the Archie Internet information system using the Prospero virtual filesystem protocol. Archie provides information about files available for ftp anywhere on the Internet; Xarchie displays this information using an easy-to-use, point-and-click interface. Xarchie allows you to further explore ftp sites by xamining directories returned as query matches, and allows you to retrieve files located this way.

NAME

xgopher - gopher client for the X window system

SYNOPSIS

xgopher [server [port]

DESCRIPTION

xgopher is an X window system client interface to the gopher information server.

NAME

xrn - an X-based interface to the USENET news system that uses the NNTP remote news server

SYNOPSIS

xrn

DESCRIPTION

xrn is an X-based interface to the USENET news system that uses the NNTP remote news protocol for accessing newsgroups and articles on an NNTP server, thus allowing users to read news from personal workstations by accessing a central news repository.

Compilation of C and C++ programs

NAME

cc - configurable C compiler

SYNOPSIS

cc [ options] file ...

DESCRIPTION

cc is the interface to a choice of C compilation systems. There are two supported compilation systems available: GNU C and USL's CI5. Regardless of which underlying compilation system is used, the command line syntax will always be the USL CI5 syntax described in this manual page. cc will use GNU C by default, or you may actively choose which compilation system to execute by setting the environment variable CCCOMPILER to either gnu or ci5. Compilation systems other than CI5 or GNU C can also be used with the configurable cc command.

Components

The compilation tools conceptually consist of a preprocessor, compiler, optimizer, basic block analyzer, assembler, and link editor. cc processes the supplied options and then executes the various tools with the proper arguments. cc accepts several types of files as arguments. Suffixes of source file names indicate the language and kind of processing to be done:

.cC source; preprocess, compile, assemble

.ipreprocessed C; compile, assemble

.sAssembler source; assemble

.hC header (preprocessor ) file; not usually named on command line

.oObject file

.aArchive file

a.outlink-edited output file

Options

-I dir Alter the search for included files whose names do not begin with / to look in dir prior to the usual directories.

-L dir Add dir to the list of directories searched for libraries by ld This option and its argument are passed to ld.

-l name Search the library libname.so or libname.a Its placement on the command line is significant as a library is searched at a point in time relative to the placement of other libraries and object files on the command line.

-O Arrange for compilation phase optimization. This option has no effect on .s files.

-o pathname Produce an output object file pathname, instead of the default a.out.

Directories

LIBDIR is usr/ccs/lib

INCDIR is usr/include

BINDIR is usr/ccs/bin

NAME

gcc, g++ - GNU project C and C++ Compiler

c++ is same as g++

SYNOPSIS

gcc [option | filename ]...

g++ [option | filename ]...

DESCRIPTION

The C and C++ compilers are integrated. Both process input files through one or more of four stages: preprocessing, compilation, assembly, and linking. Source filename suffixes identify the source language, but which name you use for the compiler governs default assumptions:

gcc assumes preprocessed (.i) files are C and assumes C style linking.

g++ assumes preprocessed (.i) files are C++ and assumes C++ style linking.

Suffixes of source file names indicate the language and kind of processing to be done:

.c C source; preprocess, compile, assemble

.C C++ source; preprocess, compile, assemble

.cc C++ source; preprocess, compile, assemble

.i preprocessed C; compile, assemble

.ii preprocessed C++; compile, assemble

.s Assembler source; assemble

.S Assembler source; preprocess, assemble

.h Preprocessor file; not usually named on command line

.o Object file

.a Archive file

Options

options for cc and many more, see the man gages for gcc.

Directories

LIBDIR is /usr/ccs /lib/

LIBDIR/libgcc.a GCC subroutine library

/lib/libc.astandard C library

/usr/includestandard directory for #include files

LIBDIR/includestandard gcc directory for #include files

LIBDIR/g++-include additional g++ directory for #include

Useful tools

NAME

audemo - NCDAudio record and play demo

SYNOPSIS

audemo [-audio servername][directory]

DESCRIPTION

audemo provides an X-based window-oriented user interface to the NCDaudio service. It allows the user to play prerecorded sound files, record new sound files and to manipulate NCDaudio buckets.

PLAYING A SOUND FILE

audemo can play sound files in any of the following file formats:

NeXT/Sun : Filenames in this format typically have a .snd or .au suffix.

RIFF WAVE: This is format used by Microsoft Windows 3.1. Filenames in this format typically have a.wav suffix.

Creative Voice: This format is produced by PCs using the Creative Labs Soundblaster card. filenames in this format typically have a .voc suffix.

To play a sound file you must first select it from the list of files in the file window. You can control which files are listed in this window by editing the directory and/or Template fields and clicking on the Rescan button. To select a file, single-click on the filename. This will highlight the filename and display information about the file in the information window. Once the file has been selected, you can start it playing by clicking on the Play command button. A shortcut for playing a file is to doubleclick on the file name. This will select the file and start it playing. When a file is playing, the Play command button is highlighted. To stop the playing of a file, click on the highlighted Play button. To enable the left and right level meters, click on the Meter button before starting to play the file. To disable the left and right level meters, click again on the highlighted Meter button. To adjust the volume level, use the volume slider.

NAME

ghostview - View PostScript documents using ghostscript

SYNOPSIS

ghostview [filename]

DESCRIPTION

The ghostview program provides an X11 user interface for the ghostscript interpreter. Ghostview and ghostscript function as two cooperating programs. Ghostview creates the viewing window and ghostscript draws in it.

NAME

gs - Ghostscript interpreter/previewer

SYNOPSIS

gs [ file ] ...

DESCRIPTION

Ghostscript is a programming language similar to Adobe Systems' PostScript language, which is in turn similar to Forth. Gs reads files in sequence and executes them as Ghostscript programs. After doing this, it reads further input from the standard input stream (normally the keyboard). Each line is interpreted separately. To exit from the interpreter, enter the `quit' command. The interpreter also exits gracefully if it encounters end-of-file.

NAME

mpeg_play - plays mpeg-1 encoded bitstreams using X11

SYNOPSIS

mpeg_play [ -display display_name ] file_name

DESCRIPTION

mpeg_play decodes and displays mpeg-1 encoded bitstreams on systems running X11. The player will create a new window, display the bitstream, and exit.

NAME

opsi - OpenSide interactive graphical user interface generator

SYNOPSIS

opsi

DESCRIPTION

OpenSide is an interactive graphical user interface generator based on Motif and Wiz language. It can interpret wiz language programs.

NAME

xdtm - graphical shell for X

SYNOPSIS

xdtm

DESCRIPTION

The X Desktop Manager is a graphical shell for the X Window System. It provides facilities to list directories graphically, view files, copy, move, and delete files, and to launch programs.

NAME

xdvi - DVI previewer for the X Window System

SYNOPSIS

xdvi dvi_file

DESCRIPTION

Xdvi is a program which runs under the X window system. It is used to preview DVI files, such as are produced by TeX.

NAME

xmaple - Interactive computer algebra system for X

SYNOPSIS

xmaple

DESCRIPTION

Initiate a session with the Maple Computer Algebra System. Expressions are read from standard input and the results reproduced on the standard output as each input expression is read. Maple has the ability to algebraically manipulate unbounded integers, exact rational numbers, real numbers with arbitrary precision, symbolic formulae, polynomials, sets, lists, and equations. It can solve systems of equations and differentiate and integrate formulae. maple can display 3D graphics.

NAME

xv - interactive image display for the X Window System

SYNOPSIS

xv [filename [filename...]]

DESCRIPTION

xv is an X11 program that displays images in the GIF, JPEG, TIFF, PBM, PGM, PPM, X11 bitmap, Utah Raster toolkit RLE, PDS/VICAR, Sun Rasterfile, BMP, PCX, IRIS RGB, possibly PostScript, and PM formats on workstations and terminals running the X Window System, Version 11.


Horváth, Gyula , horvath@inf.u-szeged.hu
Last updated 1 September 1995