Note: Most but not all of the commands listed
herein are part of UNIX, some may not be available on every UNIX system. These
commands are available on rci and eden. Where the behavior is different between
eden and rci it will be noted.
NOTE: Items in italics indicate
either a place holder where you would place specific information or and item
that may be omitted.
Command |
Description |
Usage |
On-line Help | ||
man |
display reference manual pages |
man cmd_name |
Basic Options: |
| |
whereis |
locate the executable, source, and man page files |
whereis command |
Basic Option: |
whereis -h | |
Communicating With Other Users | ||
chfn |
change finger entry |
chfn |
finger |
lists information about users |
finger username |
Basic Option: |
finger -h | |
from |
see who your mail is from |
from |
Basic Option: |
from -h | |
ftp |
file transfer protocol |
ftp computer.domain |
|
not supported |
|
mesg |
permit or deny messages from write and talk |
mesg y or mesg n |
pine |
mail program recommended by RUCS |
pine |
Basic Option: |
pine -h | |
talk |
"talk" to another currently logged in user |
talk username |
telnet |
login on another computer on the network |
telnet computer |
w |
list who is on the system and what they are doing |
w |
who |
list who is on the system |
who |
whodo |
list who is on the system and what they are doing |
whodo |
write |
send an interactive message to another user |
write username |
zmail |
mail program, not supported, may be removed soon |
zmail |
Basic Options: |
| |
zmlite |
mail program, not supported, may be removed soon |
zmlite |
Basic Option: |
zmlite -h | |
Dealing with the File System | ||
cat |
concatenate and display arguments to standard output |
cat file |
cd |
change directory |
cd path |
Basic Option: |
cd -h | |
chmod |
set the protections on a file |
chmod code file |
In the numeric mode the three numbers represent the protections for the user, group and others. Each number is a sum of 1 (for execute access), 2 (for write/delete access) and 4 (for read access). "chmod 750 file.name" sets full access for the user, read and execute for the group and no access for others |
chmod ### file | |
In the symbolic mode the options first indicate whose access is to be changed u (user, you), g (group), o (other), or a (all); then indicate the type of action + (add), - (delete), or = (set); and then specify the access to be set r (read), w (write/delete), or x (execute). &qiot;chmod o-rwx file.name" denies others from having any access to file.name and has no affect on user/group access |
chmod ugoa+-=rwx file | |
Basic Option: |
chmod -R code file | |
cp |
copy files |
cp fromfile tofile |
Basic Option: |
cp --help | |
diff |
compares two files and reports the differences |
diff file1 file2 |
Basic Option: |
diff --help | |
du |
display disk usage |
du |
Basic Options: |
du -k | |
file |
determine the type of a file |
file filename |
Basic Option: |
file -h | |
ftp |
file transfer protocol |
ftp computer.domain |
grep |
search for a character string in a file |
grep string file |
Basic Options: |
grep -v string file | |
gzip |
compress a file to take up less space |
gzip filename |
Basic Option: |
gzip -h | |
gunzip |
re-expand compressed files |
gunzip filename |
Basic Option: |
gunzip -h | |
head |
Show the first 10 lines of a file |
head filename |
Basic Options: |
head -20 filename | |
ispell |
check the spelling of the contents of a file |
ispell file |
Basic Option: |
ispell -h | |
less |
browse or page through a text file. |
less file |
Basic Option: |
less -h | |
lpq |
check the status of a print queue |
lpq |
Basic Option: |
lpq -Pprinter_name | |
lpr |
send a job to a print queue |
lpr options file(s) |
Basic Options: | ||
lprm |
remove a print job from a print queue |
lprm print_job_# |
ls |
list the contents of a directory |
ls options files(s) |
Basic Options: | ||
mkdir |
create a new subdirectory in the current directory |
mkdir subdir |
create a new subdirectory, in the indicated target directory |
mkdir subdir targetdir | |
Basic Option: |
mkdir --help | |
more |
browse or page through a text file. |
more file |
Basic Option: |
more -h | |
mv |
move or rename files |
mv fromfile tofile |
Basic Option: |
mv --help | |
pr |
prepare text for printing with headers and page breaks |
pr file |
Basic Options: |
pr -h "header text" file | |
lpc |
Work with the available printer queues |
lpc status all |
pwd |
display the current directory's full pathname |
pwd |
quota |
check to see if over allowed usage, no response if not |
quota |
Basic Option: |
| |
rm |
remove (delete) files |
rm file |
Basic Options: |
| |
Note: Once a file is deleted, you can't undelete it. Use the -i option to have UNIX ask if you are sure about removing the file. | ||
rmdir |
remove empty directories |
rmdir dirname |
Basic Option: |
rmdir --help | |
sort |
sort input |
sort filename |
Basic Option: |
sort -n filename | |
tail |
show last 10 lines of a file |
tail filename |
Basic Options: |
tail -20 filename | |
touch |
update the time stamp on existing files, create new empty files |
touch file |
Basic Option: |
touch --help | |
umask |
display or set the accesses to be denied on newly created
files |
umask ### |
If used alone, display current value, leading zeros not shown |
umask | |
wc |
display the number of lines, words and characters in a file |
wc filename |
Basic Option: |
wc --help | |
Work Environment | ||
alias |
create a new name for a command or series of commands |
alias newname oldname |
chsh |
change login shell |
chsh |
clear |
clear the terminal screen |
clear |
echo |
display indicated text or variable contents |
echo text |
exit |
log off the system |
exit |
id |
display your system ID numbers |
id |
logout |
log off the system |
logout |
passwd |
change the login password |
passwd |
printenv |
show your current environment variable settings |
printenv |
script |
make a copy of everything displayed on the screen |
script filename |
Options: |
script -a filename | |
setenv |
set environment variables |
setenv varname value |
unalias |
unset an alias that was previously set |
unalias aliasname |
unsetenv |
unset environment variables |
unsetenv varname |
reset |
reset the terminal screen |
reset |
whoami |
display the current username |
whoami |
Basic Option: |
whoami -h | |
Controlling your jobs | ||
bg |
run the indicated job in the background |
bg %job# |
fg |
move a job from the background to the foreground |
fg %job# |
jobs |
list current jobs and their status |
jobs |
Basic Option: |
jobs -h | |
kill |
terminate a process |
kill %job# |
nohup |
run a command immune to hang-ups |
nohup command |
ps |
list current processes |
ps |
News Programs | ||
msg |
use nn to read the system announcements newsgroup |
msg |
nn |
news reading program |
nn |
nnpost |
news posting utility |
nnpost |
Emacs Text Editor | ||
emacs |
the emacs editor |
emacs filename |
teach-emacs |
the emacs on-line tutorial |
teach-emacs |
Languages | ||
adb |
general purpose program debugger |
adb objectcode |
cc |
C compiler: |
cc file.c |
Basic Option: |
cc -flags | |
CC |
C++ compiler: |
CC file.c |
Basic Option: |
CC -flags | |
dbx |
program debugger |
dbx executable |
f77 |
FORTRAN 77 compiler: |
f77 file.f |
Basic Option: |
f77 -flags | |
f90 |
FORTRAN 90 compiler: |
f90 file.f90 |
Basic Option: |
f90 -flags | |
gcc |
Gnu C compiler: |
gcc file.c |
g++ |
Gnu C++ compiler: |
g++ file.c |
lint |
attempts to detect features of C programs that are likely to be errors, non-portable, or wasteful |
lint file.c |
Basic Option: |
lint -flags | |
make |
facilitates compilation of several program modules |
make |
Basic Option: |
make -h | |
pc |
Pascal compiler: |
pc file.p |
Basic Option: |
pc -flags | |
Web Browsers | ||
lynx |
text only web browser, usable in telnet sessions |
lynx |
Basic Option: |
lynx -h | |
netscape |
graphic web browser, usable on X terminals |
netscape & |
Basic Option: |
netscape -h | |
Miscellaneous Information | ||
cal |
display the calendar of the current month |
cal |
date |
show the current system date and time |
date |
dict |
electronic dictionary, thesaurus, familiar quotations, and CIA world factbook |
dict |
Options: |
dict -d | |
units |
converts units in one scale to another |
units |
Basic Option: |
units -h |
Metacharacters are a group of characters that have special meanings to the UNIX operating system. Metacharacters can make many tasks easier by allowing you to redirect information from one command to another or to a file, string multiple commands together on one line, or have other effects on the commands they are issued in. The following table lists some of the metacharacters for the Rutgers default shell (the T shell).
Metacharacter |
Description |
* |
A wild card character that matches any group of characters of any length, allowing a user to specify a large group of items with a short string. For example, to specify all the files that start with 'abc', you use abc*. |
? |
A wild card character that matches any single character. Thus ls ??? lists files in the current directory whose names are only three characters long, while ls ???.* lists those files with a three letter main name and any extension. |
[..] |
A set of characters that can be matched. Thus ls [a-c]*.??? lists all files that begin with a, b, or c and have a three letter extension and lpr [ad]* prints all files that begin with a or d. |
$ |
Indicates that the following text is the name of a shell (environment) variable whose value is to be used. |
| |
Separates commands to form a pipe (see redirection in "Intermediate Use Of The UNIX Operating System"). |
< |
Redirect the standard input (see redirection in "Intermediate Use Of The UNIX Operating System"). |
> |
Redirect the standard output (see redirection in "Intermediate Use Of The UNIX Operating System") replace current contents. |
>> |
Redirect the standard output (see redirection in "Intermediate Use Of The UNIX Operating System") appends to current contents. |
>& |
Redirect the standard output and standard error (see redirection in "Intermediate Use Of The UNIX Operating System") replace current contents. |
>>& |
Redirect the standard output an standard error (see redirection in "Intermediate Use Of The UNIX Operating System") appends to current contents. |
% |
Introduces a job name (see multitasking in "Intermediate Use Of The UNIX Operating System"). |
& |
Place a process into the background (see multitasking in "Intermediate Use Of The UNIX Operating System"). |
() |
Encloses a sequence of commands or pipes to be executed as a single command. |
! |
Precedes a history substitution (see "man history") |
; |
Separates sequences of commands (or pipes) that are on one line. |
&& |
Separates two sequences of commands or pipes the second of which is executed only if the first succeeds. |
|| |
Separates two sequences of commands or pipes the second of which is executed only if the first fails. |
\ |
Used to "quote" the following metacharacter so it it treated as a plain character, as in \*. |
In the default Rutgers UNIX shell (the T shell) with the default editor set to emacs, commands may be edited and previous commands retrieved using control characters:
<CTRL>a |
move the cursor to the beginning of the line |
<CTRL>b |
move the cursor to the left |
<CTRL>c |
abort the current command |
<CTRL>d |
if not at end of the command line, delete the character at the
cursor |
<CTRL>e |
move the cursor to the end of the line |
<CTRL>f |
move the cursor to the right |
<CTRL>h |
delete the character to the left of the cursor |
<CTRL>k |
erase from the cursor to the end of the line |
<CTRL>l |
clear the screen and display current line |
<CTRL>n |
bring up next command line |
<CTRL>p |
bring up previous command line |
<CTRL>q |
continue displaying to the screen (see <CTRL>s) |
<CTRL>r |
redisplay the current line |
<CTRL>s |
stop displaying to the screen (see <CTRL>q) |
<CTRL>t |
exchange the character to the left of the cursor with the character at the cursor |
<CTRL>u |
erase the current line |
<CTRL>w |
will erase from the cursor to the beginning of the line |
<CTRL>y |
yank back the last item erased by <CTRL>k, <CTRL>u, or <CTRL>w |
<ESC> b |
move the cursor to the left one "word" |
<ESC> f |
move the cursor to the right one "word" |
<ESC> c |
move the cursor to the right one "word", capitalizing while moving |
<ESC> l |
move the cursor to the right one "word", making lower case while moving |
<ESC> u |
move the cursor to the right one "word", making upper case while moving |
04/21/02 |
|
UNIX commands |