Sampling of Unix Commands

If you’re just beginning to work on a Unix system, the abundance of commands might prove daunting. To help orient you, the following lists present a small sampling of commands on various topics.

Communication File Management

ftp File transfer protocol. cat Concatenate files or display them.

login Sign on to Unix. cd Change directory.

mailx Read or send mail. chmod Change access modes on files.

rlogin Sign on to remote Unix. cp Copy files.

talk Write to other terminals. csplit Break files at specific locations.

telnet Connect to another system. file Deter mine a file’s type.

vacation Respond to mail automatically. head Show the first few lines of a file.

Comparisons ln Create filename aliases.

cmp Compare two files, byte by byte. ls List files or directories.

comm Compare items in two sorted files. mkdir Create a dir ectory.

diff Compar e two files, line by line. more Display files by screenful.

diff3 Compar e thr ee files. mv Move or rename files or directories.

dircmp Compar e dir ectories. pwd Print working directory.

sdiff Compar e two files, side by side. rcp Copy files to remote system.

Miscellaneous rm Remove files.

banner Make posters from words. rmdir Remove directories.

bc Arbitrary precision calculator. split Split files evenly.

cal Display calendar. tail Show the last few lines of a file.

calendar Check for reminders. wc Count lines, words, and characters.

clear Clear the screen.

man Get information on a command. nice Reduce a job’s priority.nohup Pr eserve a running job after logging out.passwd Set your login password.script Produce a transcript of your login session.spell Report misspelled words.su Become a superuser.Printingcancel Cancel a printer request.lp Send to the printer.lpstat Get printer status.pr For mat and paginate for printing.Programmingcb C source code “beautifier.”

cc C compiler.

cflow C function flowchart.

ctags C function refer ences (for vi).

ctrace C debugger using function call tracing. Searching

cxref C cross-r efer ences. egrep Extended version of grep.

lint C program analyzer. fgrep Search files for literal words.

ld Loader. find Search the system for filenames.

lex Lexical analyzer generator. grep Search files for text patterns.

make Execute commands in a specified order. strings Search binary files for text patterns.

od Dump input in various formats.

strip Remove data from an object file.

truss Trace signals and system calls.

yacc Parser generator. Can be used with lex.

Storage

compress Compr ess files to free up space.

cpio Copy archives in or out.

gunzip Expand compressed (.gz and .Z) files (preferr ed).

gzcat Display contents of compressed files (may be linked to zcat).

gzip Compr ess files to free up space (preferr ed).

tar Tape archiver.

uncompress Expand compressed (.Z) files.

zcat Display contents of compressed files. Shell Programming echo Repeat command-line arguments on the output.

expr Per form arithmetic and comparisons.

line Read a line of input.

printf For mat and print command-line arguments.

sleep Pause during processing.

test Test a condition.

System Status

at Execute commands later.

chgrp Change file group.

chown Change file owner.

crontab Automate commands.

date Display or set date.

df Show free disk space.

du Show disk usage.

env Show environment variables.

finger Display information about users.

kill Terminate a running command.

ps Show processes.

stty Set or display terminal settings.

who Show who is logged on.

Text Processing

cut Select columns for display.

ex Line editor underlying vi. fmt Produce roughly uniform line lengths. join Merge differ ent columns into a database. nawk New version of awk (patter n-matching language for textual database files). paste Merge columns or switch order.

sed Noninteractive text editor.

sort Sort or merge files.

tr Translate (redefine) characters.

uniq Find repeated or unique lines in a file.

vi Visual text editor.

xargs Pr ocess many arguments in manageable portions.

HOME INDEX NEXT