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

List of Unix Commands

This document lists Unix/Linux commands and provides a brief description of their function. It includes over 100 commands ranging from basic file manipulation like cp, ls, and rm to more advanced commands for programming, debugging, printing, and networking. The commands are organized alphabetically making it easy to look up a specific command's usage.

Uploaded by

Dhaval Suthar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
75 views

List of Unix Commands

This document lists Unix/Linux commands and provides a brief description of their function. It includes over 100 commands ranging from basic file manipulation like cp, ls, and rm to more advanced commands for programming, debugging, printing, and networking. The commands are organized alphabetically making it easy to look up a specific command's usage.

Uploaded by

Dhaval Suthar
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 16

List of Unix/Linux Commands

Command Function
addbib Create or extend a bibliographic database.
alias Create short nicknames for long commands.
apropos Locate commands by keyword lookup.
ar Create library archives and add or extract files.
at, batch Execute a command at a specified time.
awk Start a pattern scanning and processing language.
banner Display a string in large letters.
basename Display portions of path names and file names.
biff Give notice of incoming mail messages.
bin-mail, binmail Start a mail-processing program.
cal Display a calendar.
calendar Start a simple reminder service.
cat Concatenate and display.
cb Start a simple C program beautifier.
cc Start a C compiler.
cd, chdir Change the working directory.
checknr Check nroff and troff input files and report possible errors.
chgrp Change the group ownership of a file.
chmod Change the permissions mode of a file.
chown Change the ownership of a file or directory to another user.
clear Clear the screen.
cmp Perform a byte-by-byte comparison of two files.
colcrt Filter nroff output for a terminal lacking overstrike capability.
comm Display lines in common, and lines not in common, between two sorted lists.
compress Compress files.
cp Copy or duplicate a file.
cpio Copy file archives in and out of an archive file.
cpp Start the C language preprocessor.
csh Start a shell (command interpreter) with a C-like syntax and interactive
features.
ctags Create a tags file for use with ex and vi.
date Display or set the date.
dbx Start a source-level debugger.
deroff Remove nroff, troff, tbl, and eqn constructs.
df Report the free disk space on file systems.
diff Display line-by-line differences between pairs of text files.
dtree Display the directory structure.
du Display the number of disk blocks used per directory or file.
echo Echo arguments to the standard output.
ed, red Start a basic line editor.
enscript Print a text file in a special way.
eqn, neqn, checkeq Typeset mathematics.
error Insert compiler error messages at the responsible source-file lines.
ex, edit, e Start a line editor.
exit Exit the current shell (may log you out).
expand, unexpand Expand Tab characters to Space characters, and vice versa.
expr Evaluate an argument as a logical, arithmetic, or string expression.
file Determine the type of a file by examining its contents.
find Find files by name, or by other characteristics.
finger Display information about users.
fmt, fmt_mail Start a simple text and mail-message formatter.
fold Fold long lines for display on an output device of a given width
ftp Start a file transfer program.
gcore Get core images of the running processes.
gprof Display call-graph profile data.
grep Search a file or files for a regular expression or a string.
groups Display a user's group memberships.
gzip Compress a file and add the extension .gz
gunzip Restores a compressed file to its unencoded state.
hashmake, Report spelling errors.
hashcheck
head Display the first few lines of a text file.
history Show the name of the current host system.
imake Open the C preprocessor interface to the make utility.
indent Indent and format a C program source file.
install Install files.
join Apply this relational database operator.
kill Terminate a process.
last Show the last logins by a user or terminal.
ld, ld.so Open the link editor, or dynamic link editor.
leave Remind user when to leave.
less Show one page at a time (opposite of more).
lex Start a lexical analysis program generator.
lint Start a C program verifier.
ln Make hard or symbolic links to files.
login Log in to the system.
look Find words in the system dictionary or lines in a sorted list.
lookbib Find references in a bibliographic database.
lorder Find an ordering relation for an object library.
lp, cancel Send/cancel requests to a printer.
lpq Display the queue of printer jobs.
lpr Send a job to the printer.
lprm Remove jobs from the printer queue.
ls List the contents of a directory.
mail, Mail Read or send mail messages.
make Maintain, update, and regenerate related programs and files.
man Display Unix reference manual pages; get help on a command.
mesg Permit or deny messages on the terminal.
mkdir, md Make a directory.
mkstr Create an error message file by massaging C source files.
more, page Display a text file one page at a time.
mv Move or rename files.
nawk Start the pattern scanning and processing language.
nice Run a command at low priority.
nm Print a symbol name list.
nroff Format documents for display or for a line-printer.
od Make an octal, decimal, hexadecimal, or ascii dump.
passwd, Change local or Network Information
chfn, chsh System (NIS) password.
paste Join corresponding lines of several files or subsequent lines of one file.
pr Prepare file(s) for printing.
printenv Display the environment variables currently set.
prof Display profile data.
ps Display the status of current processes.
ptx Generate a permutated index.
pwd Display the path name of the current working directory.
quota Display a user's disk quota and usage.
ranlib Convert archives to random libraries.
rcp Copy remote files.
rcs Change RCS (revision history) file attributes.
rcsdiff Compare RCS revisions.
rev Reverse the order of characters in each line.
rlogin Remote log in to another machine (see telnet).
rm, rmdir Remove (unlink) a file or directory.
roffbib Format and print a bibliographic database.
rsh Open a remote shell.
rup, ruptime Show the host status of local machines.
rusers Show whoÆs logged in on local machines.
rwall Write to all users over a network.
rwho Show whoÆs logged in on local machines.
sccs Open the front end for the Source Code Control System (SCCS)
sccs-admin, admin Create and administer SCCS history files.
sccs-cdc, cdc Change the delta commentary of an SCCS delta.
sccs-comb, comb Combine SCCS deltas.
sccs-delta, delta Make a delta to an SCCS file.
sccs-get, get Retrieve a version of an SCCS file.
sccs-help, help Ask for help regarding SCCS error or warning messages.
sccs-prs, prs Display selected portions of an SCCS history.
sccs-prt, prt Display delta table information from an SCCS file.
sccs-rmdel, rmdel Remove a delta from an SCCS file.
sccs-sact, sact Show the editing-activity status of an SCCS file.
sccs-sccsdiff, sccsdiff Compare two versions of an SCCS file.
sccs-unget, unget Undo a previous get of an SCCS file.
sccs-val, val Validate an SCCS file.
script Make a typescript of a terminal session.
sed Start a stream editor.
sh Open the shell, a standard Unix system command interpreter.
size Display the size of an object file.
sleep Suspend execution for a specified interval.
sort Sort and collate lines.
sortbib Sort a bibliographic database.
spell, spellin Report spelling errors.
split Split a file into pieces.
strings Find printable strings in an object file or in a binary file.
strip Remove symbols and relocation bits from an object file.
stty Set or alter the options for a terminal.
su Super-user; temporarily switch to a different user ID.
symorder Rearrange a list of symbols.
tabs Set tab stops on a terminal.
tail Display the last part of a file.
talk Talk to another user.
tar Create tape archives, and add or extract files.
tbl Format tables for nroff or troff.
tee Replicate the standard output.
telnet Open a connection to a remote system using Telnet protocol.
test Return true or false according to a conditional expression.
tftp Open a trivial file transfer program.
time Time a command.
touch Update the access and modification times of a file.
troff Typeset or format documents.
true, false Provide truth values.
tsort Perform a topological sort.
tty Display the name of the terminal.
ue Start the Full Screen Text Editor Version 3.9e.
ul Underline.
uncompress Expand compressed files.
unifdef Resolve and remove ifdef'd lines from cpp input.
uniq Remove or report adjacent duplicate lines.
units Start the conversion program.
uptime Show how long the system has been up.
users Display a compact list of users logged in.
uucp, uulog, uuname Copy from system to system.
uudecode Decode the ASCII representation of a binary file.
uuencode Encode a binary file.
uusend Send a file to a remote host.
uux Perform remote system command execution.
vacation Reply to mail automatically.
vgrind Grind nice program listings.
vi, view, vedit Start the visual display editor based on ex.
vtroff Troff to a raster plotter.
w Show who is logged in and what they are doing.
wait Wait for a process to finish.
wall Write to all users logged in.
wc Display a count of lines, words, and characters.
what Extract SCCS-version information from a file.
whatis Display a one-line summary of a keyword.
whereis Locate the binary, source, and manual page files for a command.
which Locate a command; display its path name or alias.
who Show who is logged in on the system.
whoami Display the effective current user name.
write Write a message to another user.
xargs Construct the arguments list(s)
  and execute a command.
xstr Extract strings from C programs to implement shared strings.
yacc Start yet another compiler-compiler, a parsing program generator
yes Be repetitively affirmative.
zcat Display compressed files.
An A-Z Index of the Linux BASH command line
alias Create an alias
awk Find and Replace text within file(s)

break Exit from a loop


builtin Run a shell builtin

cal Display a calendar


case Conditionally perform a command
cat Display the contents of a file
cd Change Directory
chgrp Change group ownership
chmod Change access permissions
chown Change file owner and group
chroot Run a command with a different root directory
cksum Print CRC checksum and byte counts
clear Clear terminal screen
cmp Compare two files
comm Compare two sorted files line by line
command Run a command - ignoring shell functions
continue Resume the next iteration of a loop
cp Copy one or more files to another location
cron Daemon to execute scheduled commands
crontab Schedule a command to run at a later time
csplit Split a file into context-determined pieces
cut Divide a file into several parts

date Display or change the date & time


dc Desk Calculator
dd Data Dump - Convert and copy a file
declare Declare variables and give them attributes
df Report filesystem disk space usage
diff Display the differences between two files
diff3 Show differences among three files
dir Briefly list directory contents
dircolors Colour setup for `ls'
dirname Convert a full pathname to just a path
dirs Display list of remembered directories
du Estimate file space usage

echo Display message on screen


ed A line-oriented text editor (edlin)
egrep Search file(s) for lines that match an extended expression
eject Eject CD-ROM
enable Enable and disable builtin shell commands
env Display, set, or remove environment variables
expand Convert tabs to spaces
export Set an environment variable
exec Execute a command
expr Evaluate expressions
eval Evaluate several commands/arguments

factor Print prime factors


false Do nothing, unsuccessfully
fdformat Low-level format a floppy disk
fdisk Partition table manipulator for Linux
fgrep Search file(s) for lines that match a fixed string
find Search for files that meet a desired criteria
fmt Reformat paragraph text
fold Wrap input lines to fit in specified width
for Expand words, and execute commands
format Format disks or tapes
free Display memory usage
function Define Function Macros

gawk Find and Replace text within file(s)


getopts Parse positional parameters
grep Search file(s) for lines that match a given pattern
groups Print group names a user is in
gzip Compress or decompress named file(s)

hash Remember the full pathname of a name argument


head Output the first part of file(s)
history Command History
hostname Print or set system name

id Print user and group id's


if Conditionally perform a command
import Capture an X server screen and save the image to file
info Help info
install Copy files and set attributes

join Join lines on a common field

kill Kill a process

less Display output one screen at a time


let Perform arithmetic on shell variables
ln Make links between files
local Create variables
logname Print current login name
logout Exit a login shell
lpc Line printer control program
lpr Off line print
lprint Print a file
lprintd Abort a print job
lprintq List the print queue
lprm Remove jobs from the print queue
ls List information about file(s)

m4 Macro processor
man Help manual
mkdir Create new folder(s)
mkfifo Make FIFOs (named pipes)
mknod Make block or character special files
more Display output one screen at a time
mount Mount a file system
mtools Manipulate MS-DOS files
mv Move or rename files or directories

nice Change job scheduling priority


nl Number lines and write files
nohup Run a command immune to hangups

passwd Modify a user password


paste Merge lines of files
pathchk Check file name portability
popd Restore the previous value of the current directory
pr Convert text files for printing
printcap printer capability database
printenv Print environment variables
printf Format and print data
pushd Save and then change the current directory
pwd Print Working Directory

quota Display disk usage and limits


quotacheck Scan a file system for disk usage
quotactl Set disk quotas

ram ram disk device


read read a line from standard input
readonly Mark variables/functions as readonly
remsync Synchronize remote files via email
return Exit a shell function
rm Remove files
rmdir Remove folder(s)
rpm Remote Package Manager
rsync Synchronize file trees

screen Terminal window manager


sdiff Merge two files interactively
sed Stream Editor
select Accept keyboard input
seq Print numeric sequences
set Manipulate shell variables and functions
shift Shift positional parameters
shopt Shell Options
sleep Delay for a specified time
sort Sort text files
source Run commands from a file `.'
split Split a file into fixed-size pieces
su Run a command with substitute user and group id
sum Print a checksum for a file
symlink Make a new name for a file
sync Synchronize data on disk with memory

tac Concatenate and write files in reverse


tail Output the last part of files
tar Tape ARchiver
tee Redirect output to multiple files
test Evaluate a conditional expression
time Measure Program Resource Use
times User and system times
touch Change file timestamps
trap Run a command when a signal is set(bourne)
tr Translate, squeeze, and/or delete characters
true Do nothing, successfully
tsort Topological sort
tty Print filename of terminal on stdin
type Describe a command

ulimit Limit user resources


umask Users file creation mask
umount Unmount a device
unalias Remove an alias
uname Print system information
unexpand Convert spaces to tabs
uniq Uniquify files
units Convert units from one scale to another
unset Remove variable or function names
unshar Unpack shell archive scripts
until Execute commands (until error)
users Print login names of users currently logged in
uuencode Encode a binary file
uudecode Decode a file created by uuencode

v Verbosely list directory contents (`ls -l -b')


vdir Verbosely list directory contents (`ls -l -b')

watch Execute/display a program periodically


wc Print byte, word, and line counts
which Show full path of commands
while Execute commands
who Print all usernames currently logged in
whoami Print the current user id and name (`id -un')
yes Print a string until interrupted

.period Run commands from a file


### Comment / Remark
Utility or Command Use/Description
Passwd Changes password
Nslookup Queries Internet domain name servers
Quota Displays disk usage and limits
Motd Message of the Day
finger username User information lookup program
man or xman command Displays pages of online manual
xman Displays System Manual in X
less filename or more Displays the contents of a file in the terminal one page at a
filename time
Displays information and documentation on shells, utilities
info
and programs
clear Clears the terminal window
ls directory List contents of a directory
cat filename Displays the contents of a file in the terminal
rm filename Removes a file
pico filename or emacs
Opens and edits text files
filename
cp sourcefile
Copies a file
detstinationfilename
lpr filename Sends file to printer
grep string filename looks through files for strings
head filename Displays first 10 lines of file
tail filename Displays last 10 lines of file
mv existingfilename
Moves or renames file
newfilename
lpq filename Displays files in printing queue
lprm filename Removes file from printing queue
sort filename Displays and sorts file contents
diff filename1 filename2 Displays differences between files
file filename Displays information about file contents
echo string Copies string to terminal
date Displays current date and time
cal Displays calendar
gzip filename Compresses a file
compress filename Compresses a file
gunzip filename Decompresses a compressed file
zcat filename Displays contents of a compressed file
apropos command Lists all man page titles/headers that contain the command
lynx Text based web browser
dmesg Displays kernel ring buffer
which command Displays path to command
whereis command Displays paths to locations of commands
who Lists currently logged on users
finger Obtains detailed information about a user currently using the
username@hostname system
w Lists currently logged on users with processing usage
mesg y/n Sets options for letting other users write you messages
write user Sends message to other users
talk user Allows two way chat to other users
chmod permissions
Changes file access permissions
filename
mkdir directoryname Makes a directory
rmdir directoryname Removes an empty directory
ln existingfile new-link Creates link to an existing file (hard link)
stat filename Lists information about a file
ln -s existingfile new-link Creates link to an existing file (soft link)
df Displays all mounted filesystems
ps Reports process status
Sends a job to the background (job: one or more commands
command & connected by a pipe "|" or pipes) The operating system
assigns a number to the job when you press return. example:
[1] 3578
top Displays updating list of currently running processes
tty Displays the name of the terminal in which the command
was issued
command > filename Redirects standard output 
command < filename Redirects standard input
cat file1 >> file2 Appends standard output from file1 to file2
cat /dev/null > filename or Redirects "bit bucket" or null string to file (only superuser
filename > /dev/null has write access to this file)
Pipe sends standard output of one command to the standard
command1 | command2
input of another command
tr string1 string2 < Translates each character in string1 to the corresponding
inputfile character in string2
command | tee filename | Sends the output of one command to standard output and a
grep string file
bg %job number Sends job to the background by job number
fg %job number Brings job to the foreground by job number
Aborts a process by PID (Process Identification Number) or
kill PID or %job number
job number
jobs Displays a list of current jobs
netcfg Utility to set up PPP and network configurations
xev Utility used to see information flow from X server to client
Environment variable that displays the ID string for a
echo $DISPLAY
window
echo $PATH Variable that displays executable path
netstat Displays network connections
viewres Graphical class browser for X
Game featuring Bill Gates trying to put windows on Macs
xbill
and NeXT workstations
xevil Game similar to Loderunner?
xchomp Linux's version of PacMan
xcmap Strange color lookup utility
xedit Text editor for X
asclock Clock from AfterStep
xconsole Strange console for X
xmessage message Sends message to a dialog box
xgal XGalaga game
xg3 Image viewing program
xgc Graphing calculator?
xjewel Jewel game for Linux
xkbvleds LEDs?
xkbwatch LEDs?
xlogo Displays X logo
xmixer Opens system sound controls
xsnow Snowflakes are fallin' on your desktop
xwininfo Displays info about a window
startx Starts an X Window System server
ghostview Starts a text preview application
xv filename Image viewer
xsetroot -color Set background color in X
xcalc Starts a calculator in X
xclipboard Starts a clipboard in X
traceroute host Prints the route packets take to the host
hostname Displays system identity name
rlogin host Utility to connect to a remote system
Utility to connect to a remote system (similar to rlogin but
telnet host
more interactive)
rcp file remotemachine Used to copy from a remote computer
ftp Utility to transfer files between systems on a network
Utility to run a command on a remote system without
rsh command
logging in
ping host Utility used to test connection to a remote system
Changes local machine directory while logged on to remote
lcd directorypath
machine
Shared Directories
Directory Description
Root - The root directory is present in all Linux system file structures. It's the
/
parent of all files in the system.
Essential common binaries - Holds files needed to boot the system and run
/bin
it when it comes up in single user mode.
/boot Static files of the boot loader.
/dev Device files - All files that represent peripheral devices.
Machine-local system configuration - Holds administrative, config, and
/etc other system files. Holds /etc/passwd file that contains a list of all users who
have permission to the system.
/home User home directories - Contains each user's or client's home directory
/lib Shared libraries
/mnt Mount point for temporary partitions
/proc Kernel and process information (virtual filesystem)
/root Home directory for root
/sbin Essential system binaries - Contains utilities for system administration.
/tmp Temporary files
Second major hierarchy - Includes subdirectories that contain information
/usr
used by the system.
/var Variable data - Contains files whose contents change as system runs.
vi Commands
Command Description
vi filename Starts vi and creates a new file
:q! Quits vi without saving work
p Pastes data in buffer below current line
P Pastes data in buffer above current line
yy Copies current line
:r !command Reads in output of the command
i Puts vi in insert mode
:set autoindent Sets vi to indent automatically
:set showmatch Sets vi to show matching parenthesis
:set nu Sets vi to display line numbers
:set showmode Sets vi to display the mode you're in
ESCAPE Sets vi to command mode
CONTROL-U Erases current line (insert mode)
CONTROL-H Erases on letter (insert mode)
CONTROL-W Erases current word (insert mode)
h, j, k, l Moves cursor left, up, down, right respectively
u Undoes last action
x Deletes a single character
dw Deletes a single word
dd Deletes a single line
ZZ Writes work buffer to disk and exits vi
o inserts line after cursor position
CONTROL-L Redraws screen
:w filename Save work as filename and exits
Control Characters
Key Use
CONTROL-H or BACKSPACE Erases a character on the command line
CONTROL-U Deletes an entire command line
CONTROL-W Erases a word on the command line
CONTROL-C Aborts program execution
COMMAND-Tab Switches Programs
CONTROL-L or CONTROL-R Refreshes the screen
Control-D, logout or exit Logs you off the system

You might also like