Unix / Linux - Useful Commands

This quick guide lists commands, including a syntax and a brief description. For more detail, use −
$man command

These commands allow you to create directories and handle files.
cat
Displays File Contents
cd
Changes Directory to dirname
chgrp
Changes file group
chmod
Changes permissions
cp
Copies source file into destination
file
Determines file type
find
Finds files
grep
Searches files for regular expressions
head
Displays first few lines of a file
ln
Creates softlink on oldname
ls
Displays information about file type
mkdir
Creates a new directory dirname
more
Displays data in paginated form
mv
Moves (Renames) an oldname to newname
pwd
Prints current working directory
rm
Removes (Deletes) filename
rmdir
Deletes an existing directory provided it is empty
tail
Prints last few lines in a file
touch
Updates access and modification time of a file
The contents of files can be compared and altered with the following commands.
awk
Pattern scanning and processing language
cmp
Compares the contents of two files
comm
Compares sorted data
cut
Cuts out selected fields of each line of a file
diff
Differential file comparator
expand
Expands tabs to spaces
join
Joins files on some common field
perl
Data manipulation language
sed
Stream text editor
sort
Sorts file data
split
Splits file into smaller files
tr
Translates characters
uniq
Reports repeated lines in a file
wc
Counts words, lines, and characters
vi
Opens vi text editor
vim
Opens vim text editor
fmt
Simple text formatter
spell
Checks text for spelling error
ispell
Checks text for spelling error
emacs
GNU project Emacs
ex, edit
Line editor
emacs
GNU project Emacs
Files may be compressed to save space. Compressed files can be created and examined.
compress
Compresses files
gunzip
Helps uncompress gzipped files
gzip
GNU alternative compression method
uncompress
Helps uncompress files
unzip
List, test and extract compressed files in a ZIP archive
zcat
Cat a compressed file
zcmp
Compares compressed files
zdiff
Compares compressed files
zmore
File perusal filter for crt viewing of compressed text
Various Unix manuals and documentation are available on-line. The following Shell commands give information −
apropos
Locates commands by keyword lookup
info
Displays command information pages online
man
Displays manual pages online
whatis
Searches the whatis database for complete words
yelp
GNOME help viewer
These following commands are used to send and receive files from a local Unix hosts to the remote host around the world.
ftp
File transfer program
rcp
Remote file copy
rlogin
Remote login to a Unix host
rsh
Remote shell
tftp
Trivial file transfer program
telnet
Makes terminal connection to another host
ssh
Secures shell terminal or command connection
scp
Secures shell remote file copy
sftp
Secures shell file transfer program
Some of these commands may be restricted at your computer for security reasons.
The Unix systems support on-screen messages to other users and world-wide electronic mail −
evolution
GUI mail handling tool on Linux
mail
Simple send or read mail program
mesg
Permits or denies messages
parcel
Sends files to another user
pine
Vdu-based mail utility
talk
Talks to another user
write
Writes message to another user
The following programming tools and languages are available based on what you have installed on your Unix.
dbx
Sun debugger
gdb
GNU debugger
make
Maintains program groups and compile programs
nm
Prints program's name list
size
Prints program's sizes
strip
Removes symbol table and relocation bits
cb
C program beautifier
cc
ANSI C compiler for Suns SPARC systems
ctrace
C program debugger
gcc
GNU ANSI C Compiler
indent
Indent and format C program source
bc
Interactive arithmetic language processor
gcl
GNU Common Lisp
perl
General purpose language
php
Web page embedded language
py
Python language interpreter
asp
Web page embedded language
CC
C++ compiler for Suns SPARC systems
g++
GNU C++ Compiler
javac
JAVA compiler
appletvieweir
JAVA applet viewer
netbeans
Java integrated development environment on Linux
sqlplus
Runs the Oracle SQL interpreter
sqlldr
Runs the Oracle SQL data loader
mysql
Runs the mysql SQL interpreter
These commands list or alter information about the system −
chfn
Changes your finger information
chgrp
Changes the group ownership of a file
chown
Changes owner
date
Prints the date
determin
Automatically finds terminal type
du
Prints amount of disk usage
echo
Echo arguments to the standard options
exit
Quits the system
finger
Prints information about logged-in users
groupadd
Creates a user group
groups
Show group memberships
homequota
Shows quota and file usage
iostat
Reports I/O statistics
kill
Sends a signal to a process
last
Shows last logins of users
logout
Logs off Unix
lun
Lists user names or login ID
netstat
Shows network status
passwd
Changes user password
passwd
Changes your login password
printenv
Displays value of a shell variable
ps
Displays the status of current processes
ps
Prints process status statistics
quota -v
Displays disk usage and limits
reset
Resets terminal mode
script
Keeps script of terminal session
script
Saves the output of a command or process
setenv
Sets environment variables
stty
Sets terminal options
time
Helps time a command
top
Displays all system processes
tset
Sets terminal mode
tty
Prints current terminal name
umask
Show the permissions that are given to view files by default
uname
Displays name of the current system
uptime
Gets the system up time
useradd
Creates a user account
users
Prints names of logged in users
vmstat
Reports virtual memory statistics
w
Shows what logged in users are doing
who
Lists logged in users