Unix - Useful Commands

Advertisements


This quick guide lists commands, including a syntax and brief description. For more detail, use:

$man command

Files and Directories:

These commands allow you to create directories and handle files.

CommandDescription
catDisplay File Contents
cdChanges Directory to dirname
chgrpchange file group
chmodChanging Permissions
cpCopy source file into destination
fileDetermine file type
findFind files
grepSearch files for regular expressions.
headDisplay first few lines of a file
lnCreate softlink on oldname
lsDisplay information about file type.
mkdirCreate a new directory dirname
moreDisplay data in paginated form.
mvMove (Rename) a oldname to newname.
pwdPrint current working directory.
rmRemove (Delete) filename
rmdirDelete an existing directory provided it is empty.
tailPrints last few lines in a file.
touchUpdate access and modification time of a file.

Manipulating data:

The contents of files can be compared and altered with the following commands.

CommandDescription
awkPattern scanning and processing language
cmpCompare the contents of two files
commCompare sorted data
cutCut out selected fields of each line of a file
diffDifferential file comparator
expandExpand tabs to spaces
joinJoin files on some common field
perlData manipulation language
sedStream text editor
sortSort file data
splitSplit file into smaller files
trTranslate characters
uniqReport repeated lines in a file
wcCount words, lines, and characters
viOpens vi text editor
vimOpens vim text editor
fmtSimple text formatter
spellCheck text for spelling error
ispellCheck text for spelling error
ispellCheck text for spelling error
emacsGNU project Emacs
ex, editLine editor
emacsGNU project Emacs
emacsGNU project Emacs

Compressed Files:

Files may be compressed to save space. Compressed files can be created and examined:

CommandDescription
compressCompress files
gunzipUncompress gzipped files
gzipGNU alternative compression method
uncompressUncompress files
unzipList, test and extract compressed files in a ZIP archive
zcatCat a compressed file
zcmpCompare compressed files
zdiffCompare compressed files
zmoreFile perusal filter for crt viewing of compressed text

Getting Information:

Various Unix manuals and documentation are available on-line. The following Shell commands give information:

CommandDescription
aproposLocate commands by keyword lookup
infoDisplays command information pages online
manDisplays manual pages online
whatisSearch the whatis database for complete words.
yelpGNOME help viewer

Network Communication:

These following commands are used to send and receive files from a local UNIX hosts to the remote host around the world.

CommandDescription
ftpFile transfer program
rcpRemote file copy
rloginRemote login to a UNIX host
rshRemote shell
tftpTrivial file transfer program
telnetMake terminal connection to another host
sshSecure shell terminal or command connection
scpSecure shell remote file copy
sftpsecure shell file transfer program

Some of these commands may be restricted at your computer for security reasons.

Messages between Users:

The UNIX systems support on-screen messages to other users and world-wide electronic mail:

CommandDescription
evolutionGUI mail handling tool on Linux
mailSimple send or read mail program
mesgPermit or deny messages
parcelSend files to another user
pineVdu-based mail utility
talkTalk to another user
writeWrite message to another user

Programming Utilities:

The following programming tools and languages are available based on what you have installed on your Unix.

CommandDescription
dbxSun debugger
gdbGNU debugger
makeMaintain program groups and compile programs.
nmPrint program's name list
sizePrint program's sizes
stripRemove symbol table and relocation bits
cbC program beautifier
ccANSI C compiler for Suns SPARC systems
ctraceC program debugger
gccGNU ANSI C Compiler
indentIndent and format C program source
bcInteractive arithmetic language processor
gclGNU Common Lisp
perlGeneral purpose language
phpWeb page embedded language
pyPython language interpreter
aspWeb page embedded language
CCC++ compiler for Suns SPARC systems
g++GNU C++ Compiler
javacJAVA compiler
appletvieweirJAVA applet viewer
netbeansJava integrated development environment on Linux
sqlplusRun the Oracle SQL interpreter
sqlldrRun the Oracle SQL data loader
mysqlRun the mysql SQL interpreter

Misc Commands:

These commands list or alter information about the system:

CommandDescription
chfnChange your finger information
chgrpChange the group ownership of a file
chownChange owner
datePrint the date
determinAutomatically find terminal type
duPrint amount of disk usage
echoEcho arguments to the standard options
exitQuit the system
fingerPrint information about logged-in users
groupaddCreate a user group
groupsShow group memberships
homequotaShow quota and file usage
iostatReport I/O statistics
killSend a signal to a process
lastShow last logins of users
logoutlog off UNIX
lunList user names or login ID
netstatShow network status
passwdChange user password
passwdChange your login password
printenvDisplay value of a shell variable
psDisplay the status of current processes
psPrint process status statistics
quota -vDisplay disk usage and limits
resetReset terminal mode
scriptKeep script of terminal session
scriptSave the output of a command or process
setenvSet environment variables
sttySet terminal options
timeTime a command
topDisplay all system processes
tsetSet terminal mode
ttyPrint current terminal name
umaskShow the permissions that are given to view files by default
unameDisplay name of the current system
uptimeGet the system up time
useraddCreate a user account
usersPrint names of logged in users
vmstatReport virtual memory statistics
wShow what logged in users are doing
whoList logged in users


Advertisements
Advertisements