Controlling program execution for C-shell (See man csh) - HVCC

perchmysteriousData Management

Dec 1, 2012 (4 years and 11 months ago)

226 views

Terminal control characters for C
-
shell (csh)

^h
,
backspace

erase previously typed character

^u

erase entire line of input so far typed

^d

end
-
of
-
input for programs reading from terminal

^s

suspend writing to terminal (freezes terminal)

^q

continue

writing to terminal

^z

suspend currently running job; restart with bg or fg

^c

kill currently running program and allow clean
-
up before exiting

^
\

emergency kill of currently running program with no chance of cleanup

Also see a
list of special characters

that should not be used in filenames.

Login and authentication

login

access computer; start interactive session

logout

disconnect

terminal session

passwd

change local login password; you
must

set a
strong password

that is not easily
guessed

kinit

obtain kerberos

ticket for connections to other kerberized computers

kdestroy

destroy kerberos tickets (authorizations)

Information

date

show date and time

history

list of previously executed commands

man

show online documentation by program name

info

online

documentation for GNU programs

w
,
who

who is on the system and what they are doing

whoami

who is logged onto this terminal

top

show system stats and top CPU using processes

uptime

show one line summary of system status

File management

cat

combine

files

cp

copy files

ls

list files in a directory and their attributes

mv

change file name or directory location

rm

remove files

ln

create another link (name) to a file

chmod

set file permissions

crypt

encode/decode a file with a private key

gzip
,
gunzip

compress/decompress a file

find

find files that match specific criteria

Display contents of files

cat

copy files to display device

more

show text file on display terminal with paging control

head

show first few lines of a file(s)

tail

show

last few lines of a file; or reverse line order

vi

full
-
featured screen editor for modifying text files

pico

simple screen editor for modifying text files

grep

display lines that match a pattern

lpr

send file to printer

pr

format

file with page headers, multiple columns, etc.

diff

compare two files and show differences

cmp

compare two binary files and report if different

comm

compare two files; show common or unique lines

od

display binary files as eqivalent octal/hex codes

strings

show printable text embedded in binary files

file

examine file(s) and guess type: text, data, program, etc.

wc

count characters, words, and lines in a file

Directories

cd

change to new directory

mkdir

create new directory

rmdir

remove

empty directory (you must remove files first)

mv

change name of directory

pwd

show current directory

Disks

df

summarize free space on disk filesystems

du

show disk space used by files or directories

Special character handling for C
-
shell (See man
csh)

*

match any characters in a file name

~user

shorthand for home directory of

user

$name

substitute value of variable
name

\

turn off special meaning of character that follows

'

in pairs, quote string with special chars, except
!

"

in

pairs, quote string with special chars, except
!
,
$

`

in pairs, substitute output from enclosed command

Controlling program execution for C
-
shell (See man csh)

&

run job in background

^c


kill job in foreground

^z

suspend job in foreground

fg

restart suspended job in foreground

bg

run suspended job in background

;

delimit commands on same line

()

group commands on same line

!

re
-
run earlier commands from history list

jobs

list current jobs

ps

show process information

kill

kill

background job or previous process

nice

run program at lower priority

at

run program at a later time

crontab

run program at specified intervals

limit

see or set resource limits for programs

alias

create alias name for program (normally used in
.login

file)

sh
,
csh

execute command file

Controlling program input/output for C
-
shell (See man csh)

|

pipe output to input

>

redirect output to a storage file

<

redirect input from a storage file

>>

append redirected output to a storage file

tee

copy

input to both file and next program in pipe

script

make file record of all terminal activity

Email and communication

msgs

read system bulletin board messages

mailx

send/read email; can be run by other programs to send exisiting files via email

uuencode

uudecode

encode/decode a binary file for transmission via email

rn

read USENET news groups

Editors and formatting utilities

sed

programmable text editor for data streams

vi

full
-
featured editor for character terminals

emacs

GNU emacs

editor for character terminals

xemacs

GNU emacs editor for X Window terminals

pico

very simple text editor

fmt

fill and break lines to make all same length

fold

break long lines to specified length

X Window client programs (output to X terminal or server)

xterm

provide login shell window

xauth

manipulate authorization files

xload

show system load

xman

full screen online manual viewer

xemacs

GNU emacs editor

gv

interface to contol
gs

to display PostScript or PDF files on screen

xdvi

display DVI files on X Window (screen preview)

gnuplot

interactive data plotting on screen

TeX typesetting system

tex

process TeX files to DVI (device independent) output

latex

process LaTeX

files to DVI

dvips

print DVI files on Postscript laser printer

xdvi

display DVI files on X Window (screen preview)

latex2html

translate LaTeX files to HTML (for web pages)

Printing (BSD based)

lpr

send file to print queue

lpq

examine

status of files in print queue

lprm

remove a file from print queue

enscript

convert text files to PostScript format for printing

Interpreted languages and data manipulation utilities

sed

programmable text editor for data streams

awk

pattern

scanning and processing language

perl

Practical Extraction and Report Language

sort

sort or merge lines in a file(s) by specified fields

tr

translate characters

cut

cut out columns from a file

paste

paste columns into a file

dd

copy

data between devices; reblock; convert EBCDIC

Graphics and mapping

gnuplot

interactive data plotting; outputs to PostScript or X Window

gs

"ghostscript" converter displays PostScript files on X Window displays or other
devices

Networking/communications

ssh

remote login/command execution; encrypted

scp

remote non
-
interactive file copy; encrypted

sftp

remote interactive file copy; encrypted

telnet

remote network login; plain text password
-

not recommended

ftp

network

file transfer program; plain text password
-

not recommended

host

find IP address for given host name, or vice versa

lynx

web browser for character based (text
-
only) terminals

gzip
,
gunzip

compress/decompress a file

tar

combine multiple files/dirs

into single archive

uuencode

uudecode

encode/decode a binary file for transmission via email

Compilers, interpreters and programming tools

csh

command language interpreter (C
-
shell scripts)

ksh

command language interpreter (Korn
-
shell scripts)

sh

command language interpreter (Borne
-
shell scripts)

f77

Fortran 77 compiler

f2c

convert fortran source code to C source code

gcc

GNU C compiler

g++

GNU C++ compiler

dbx

command
-
line symbolic debugger for compiled C or Fortran

make

recompile

programs from modified source

cflow

generate C flow graph

Programming libraries (see man library_name)

lapack

Fortran 77 routines for numerical linear algebra (supersedes LINPACK and
EISPACK)

X

routines

to interface with X window system (no man page
--

get the X Toolkit
book)

dbm

database routines

xdr

library routines for external data representation

netcdf

routines for machine independent data representation

Tape manipulation and archiving

mt

manipulate tape drive and position tape

dd

unformatted tape read and write; file conversion

tar

archive disk files on tape or disk

ltf

read/write ANSI standard label tapes


The
-
a

to
-
z

of Command
-
Line Options

Over time, frequently
-
used

options in well
-
known Unix programs have established a loose sort of semantic
standard for what various flags might be expected to mean. The following is a list of options and meanings
that should prove usefully unsurprising to an experienced Unix user:

-
a

All (without argument). If there is a GNU
-
style
--
all

option, for
-
a

to be anything but a
synonym for it would be quite surprising. Examples: fuser(1), fetchmail(1).

Append, as in tar(1). This is often paired with
-
d

for delete.

-
b

Buffer or block size (
with argument). Set a critical buffer size, or (in a program having to do with
archiving or managing storage media) set a block size. Examples: du(1), df(1), tar(1).

Batch. If the program is naturally interactive,
-
b

may be used to suppress prompts or set
other
options appropriate to accepting input from a file rather than a human operator. Example: flex(1).

-
c

Command (with argument). If the program is an interpreter that normally takes commands from
standard input, it is expected that the option of a
-
c

argument will be passed to it as a single line
of input. This convention is particularly strong for shells and shell
-
like interpreters. Examples:
sh(1), ash(1), bsh(1), ksh(1), python(1). Compare
-
e

below.

Check (without argument). Check the correctness of

the file argument(s) to the command, but
don't actually perform normal processing. Frequently used as a syntax
-
check option by programs
that do interpretation of command files. Examples: getty(1), perl(1).

-
d

Debug (with or without argument). Set the leve
l of debugging messages. This one is very
common.

Occasionally
-
d

has the sense of ‘delete’ or ‘directory’.





-
D

Define (with argument). Set the value of some symbol in an interpreter, compiler, or (especially)
macro
-
processor
-
like application. The model is the use of
-
D

by the C compiler's macro
preprocessor. This is a strong association for most Unix programmers; d
on't try to fight it.

-
e

Execute (with argument). Programs that are wrappers, or that can be used as wrappers, often allow
-
e

to set the program they hand off control to. Examples: xterm(1), perl(1).

Edit. A program that can open a resource in either a read
-
only or editable mode may allow
-
e

to
specify opening in the editable mode. Examples: crontab(1), and the get(1) utility of the SCCS
version
-
control system.

Occasionally
-
e

has the sense of ‘exclude
’ or ‘expression’.

-
f

File (with argument). Very often used with an argument to specify an input (or, less frequently,
output) file for programs that need to randomly access their input or output (so that redirection via
< or > won't suffice). The classic
example is tar(1); others abound. It is also used to indicate that
arguments normally taken from the command line should be taken from a file instead; see awk(1)
and egrep(1) for classic examples. Compare
-
o

below; often,
-
f

is the input
-
side analog of
-
o
.

Force (typically without argument). Force some operation (such as a file lock or unlock) that is
normally performed conditionally. This is less common.

Daemons often use
-
f

in a way that combines these two meanings, to force processing of a
configuration
file from a nondefault location. Examples: ssh(1), httpd(1), and many other
daemons.

-
h

Headers (typically without argument). Enable, suppress, or modify headers on a tabular report
generated by the program. Examples: pr(1), ps(1).

Help. This is actually l
ess common than one might expect offhand


for much of Unix's early
history developers tended to think of on
-
line help as memory
-
footprint overhead they couldn't
afford. Instead they wrote manual pages (this shaped the man
-
page style in ways we'll discuss
in
Chapter

18
).

-
i

Initialize (usually without argument). Set some critical resource or database associated with the
program to an initial or empty state. Example: ci(1) in RCS.

Interactive (usually without argument). Force a program that does not normally query for
confirma
tion to do so. There are classical examples (rm(1), mv(1)) but this use is not common.




-
I

Include (with argument). Add a file or directory name to those searched for resources by the
application. All Unix compilers with any equivalent of source
-
file inc
lusion in their languages use
-
I

in this sense. It would be extremely surprising to see this option letter used in any other way.

-
k

Keep (without argument). Suppress the normal deletion of some file, message, or resource.
Examples: passwd(1), bzip(1), and

fetchmail(1).

Occasionally
-
k

has the sense of ‘kill’.

-
l

List (without argument). If the program is an archiver or interpreter/player for some kind of
directory or archive format, it would be quite surprising for
-
l

to do anything but request an item
lis
ting. Examples: arc(1), binhex(1), unzip(1). (However, tar(1) and cpio(1) are exceptions.)

In programs that are already report generators,
-
l

almost invariably means “long” and triggers
some kind of long
-
format display revealing more detail than the defaul
t mode. Examples: ls(1),
ps(1).

Load (with argument). If the program is a linker or a language interpreter,
-
l

invariably loads a
library, in some appropriate sense. Examples: gcc(1), f77(1), emacs(1).

Login. In programs such as rlogin(1) and ssh(1) that n
eed to specify a network identity,
-
l

is how
you do it.

Occasionally
-
l

has the sense of ‘length’ or ‘lock’.

-
m

Message (with argument). Used with an argument,
-
m

passes it in as a message string for some
logging or announcement purpose. Examples: ci(1),
cvs(1).

Occasionally
-
m

has the sense of ‘mail’, ‘mode’, or ‘modification
-
time’.

-
n

Number (with argument). Used, for example, for page number ranges in programs such as head(1),
tail(1), nroff(1), and troff(1). Some networking tools that normally display
DNS names accept
-
n

as an option that causes them to display the raw IP addresses instead; ifconfig(1) and tcpdump(1)
are the archetypal examples.

Not (without argument). Used to suppress normal actions in programs such as make(1).

-
o

Output (with
argument). When a program needs to specify an output file or device by name on the
command line, the
-
o

option does it. Examples: as(1), cc(1), sort(1). On anything with a compiler
-
like interface, it would be extremely surprising to see this option used in

any other way. Programs
that support
-
o

often (like gcc) have logic that allows it to be recognized after ordinary arguments
as well as before.

-
p

Port (with argument). Especially used for options that specify TCP/IP port numbers. Examples:
cvs(1), the Po
stgreSQL tools, the smbclient(1), snmpd(1), ssh(1).

Protocol (with argument). Examples: fetchmail(1), snmpnetstat(1).

-
q

Quiet (usually without argument). Suppress normal result or diagnostic output. This is very
common. Examples: ci(1), co(1), make(1). Se
e also the ‘silent’ sense of
-
s
.

-
r

(also
-
R
)

Recurse (without argument). If the program operates on a directory, then this option might tell it to
recurse on all subdirectories. Any other use in a utility that operated on directories would be quite
surpri
sing. The classic example is, of course, cp(1).

Reverse (without argument). Examples: ls(1), sort(1). A filter might use this to reverse its normal
translation action (compare
-
d
).

-
s

Silent (without argument). Suppress normal diagnostic or result output (
similar to
-
q
; when both
are supported, q means ‘quiet’ but
-
s

means ‘utterly silent’). Examples: csplit(1), ex(1),
fetchmail(1).

Subject (with argument).
Always

used with this meaning on commands that send or manipulate
mail or news messages. It is extrem
ely important to support this, as programs that send mail
expect it. Examples: mail(1), elm(1), mutt(1).

Occasionally
-
s

has the sense of ‘size’.

-
t

Tag (with argument). Name a location or give a string for a program to use as a retrieval key.
Especially u
sed with text editors and viewers. Examples: cvs(1), ex(1), less(1), vi(1).

-
u

User (with argument). Specify a user, by name or numeric UID. Examples: crontab(1), emacs(1),
fetchmail(1), fuser(1), ps(1).

-
v

Verbose (with or without argument).

Used to enable transaction
-
monitoring, more voluminous
listings, or debugging output. Examples: cat(1), cp(1), flex(1), tar(1), many others.

Version (without argument). Display program's version on standard output and exit. Examples:
cvs(1), chattr(1), pa
tch(1), uucp(1). More usually this action is invoked by
-
V
.


-
V

Version (without argument). Display program's version on standard output and exit (often also
prints compiled
-
in configuration details as well). Examples: gcc(1), flex(1), hostname(1), many
others. It would be quite surprising for this switch to be used in any other way.

-
w

Width (with argument). Especially used for specifying widths in output formats. Examples:
faces(1), grops(1), od(1), pr(1), shar(1).

Warning (without argument). Enable war
ning diagnostics, or suppress them. Examples:
fetchmail(1), flex(1), nsgmls(1).

-
x

Enable debugging (with or without argument). Like
-
d
. Examples: sh(1), uucp(1).

Extract (with argument). List files to be extracted from an archive or working set. Examples:

tar(1), zip(1).

-
y

Yes (without argument). Authorize potentially destructive actions for which the program would
normally require confirmation. Examples: fsck(1), rz(1).

-
z

Enable compression (without argument). Archiving and backup programs often use thi
s.
Examples: bzip(1), GNU tar(1), zcat(1), zip(1), cvs(1).