Unix – Useful Commands
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.
Command | Description |
Cat | Display File Contents |
Cd | Changes Directory to dirname |
Chgrp | change file group |
Chmod | Changing Permissions |
Cp | Copy source file into destination |
File | Determine file type |
Find | Find files |
Grep | Search files for regular expressions. |
Head | Display first few lines of a file |
Ln | Create softlink on oldname |
Ls | Display information about file type. |
Mkdir | Create a new directory dirname |
More | Display data in paginated form. |
Mv | Move (Rename) a oldname to newname. |
Pwd | Print current working directory. |
Rm | Remove (Delete) filename |
Rmdir | Delete an existing directory provided it is empty. |
Tail | Prints last few lines in a file. |
Touch | Update access and modification time of a file. |
Manipulating data:
The contents of files can be compared and altered with the following commands.
Command | Description |
Awk | Pattern scanning and processing language |
Cmp | Compare the contents of two files |
Comm. | Compare sorted data |
Cut | Cut out selected fields of each line of a file |
Diff | Differential file comparator |
Expand | Expand tabs to spaces |
Join | Join files on some common field |
Perl | Data manipulation language |
Sed | Stream text editor |
Sort | Sort file data |
Split | Split file into smaller files |
Tr | Translate characters |
Uniq | Report repeated lines in a file |
Wc | Count words, lines, and characters |
Vi | Opens vi text editor |
Vim | Opens vim text editor |
Fmt | Simple text formatter |
Spell | Check text for spelling error |
Ispell | Check text for spelling error |
Ispell | Check text for spelling error |
Emacs | GNU project Emacs |
ex, edit | Line editor |
Emacs | GNU project Emacs |
Emacs | GNU project Emacs |
Compressed Files:
Files may be compressed to save space. Compressed files can be created and examined:
Command | Description |
compress | Compress files |
Gunzip | Uncompress gzipped files |
Gzip | GNU alternative compression method |
uncompress | Uncompress files |
Unzip | List, test and extract compressed files in a ZIP archive |
Zcat | Cat a compressed file |
Zcmp | Compare compressed files |
Zdiff | Compare compressed files |
Zmore | File 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:
Command | Description |
apropos | Locate commands by keyword lookup |
Info | Displays command information pages online |
Man | Displays manual pages online |
Whatis | Search the whatis database for complete words. |
Yelp | GNOME 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.
Command | Description |
ftp | File transfer program |
Rcp | Remote file copy |
rlogin | Remote login to a UNIX host |
Rsh | Remote shell |
Tftp | Trivial file transfer program |
telnet | Make terminal connection to another host |
Ssh | Secure shell terminal or command connection |
Scp | Secure shell remote file copy |
Sftp | secure 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:
Command | Description |
evolution | GUI mail handling tool on Linux |
Mail | Simple send or read mail program |
Mesg | Permit or deny messages |
Parcel | Send files to another user |
Pine | Vdu-based mail utility |
Talk | Talk to another user |
Write | Write message to another user |
Programming Utilities:
The following programming tools and languages are available based on what you have installed on your Unix.
Command | Description |
Dbx | Sun debugger |
Gdb | GNU debugger |
Make | Maintain program groups and compile programs. |
Nm | Print program's name list |
Size | Print program's sizes |
Strip | Remove 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 | Run the Oracle SQL interpreter |
Sqlldr | Run the Oracle SQL data loader |
Mysql | Run the mysql SQL interpreter |
Misc Commands:
These commands list or alter information about the system:
Command | Description |
Chfn | Change your finger information |
Chgrp | Change the group ownership of a file |
Chown | Change owner |
Date | Print the date |
determin | Automatically find terminal type |
Du | Print amount of disk usage |
Echo | Echo arguments to the standard options |
Exit | Quit the system |
Finger | Print information about logged-in users |
groupadd | Create a user group |
Groups | Show group memberships |
homequota | Show quota and file usage |
Iostat | Report I/O statistics |
Kill | Send a signal to a process |
Last | Show last logins of users |
Logou | log off UNIX |
Lun | List user names or login ID |
Netstat | Show network status |
Passwd | Change user password |
Passwd | Change your login password |
printenv | Display value of a shell variable |
Ps | Display the status of current processes |
Ps | Print process status statistics |
quota -v | Display disk usage and limits |
Reset | Reset terminal mode |
Script | Keep script of terminal session |
Script | Save the output of a command or process |
Setenv | Set environment variables |
Sty | Set terminal options |
Time | Time a command |
Top | Display all system processes |
Tset | Set terminal mode |
Tty | Print current terminal name |
Umask | Show the permissions that are given to view files by default |
Uname | Display name of the current system |
Uptime | Get the system up time |
useradd | Create a user account |
Users | Print names of logged in users |
Vmstat | Report virtual memory statistics |
W | Show what logged in users are doing |
Who | List logged in users |