UNIX needs no introduction. We all use this operating system to work, learn and program with computers. There are literally thousands of UNIX commands that a user has at his disposal.
I have compiled a quick round-up of top general purpose 50 UNIX commands to make your life easier and faster while working with the much-loved OS.
Command | Function (How to do/display) |
---|---|
cal | Show calendar of month/year |
cd dirname | Change current directory |
cd or cd $HOME | Change current directory to home directory |
chgrp | Change file's group ownership |
chown | Change file's ownership |
chmod | Change file's permissions |
cc or gcc | To compile a C language program |
cat | Concatenate files or file content |
cp | Copy files |
cat > filename | Create a file |
cut | Cut fields or columns from file |
cmp | Give differences between two files - character wise |
diff | Give difference between two files |
date | Set system date (For superuser only) |
dos2unix | Convert files from DOS to UNIX |
df | Gives free disk space |
echo > filename | Create a file |
echo | To display a message |
expr | Give string length |
groupadd | To add a user group (For superuser only) |
history | Give command history |
hostname | Give name of local host |
kill | Terminate a process |
logout | Terminate login session |
lp or lpr | To print a file |
ls | Gives file list |
ls -l | Gives directory list or file attributes |
man | Command documentation |
mv | To rename a file or directory |
mailx | To mail a message |
passwd | Change your own password |
passwd [username] | Change other user's password (For superuser only) |
pwd | To check current directory |
ping | Test connectivity of host |
printf | To echo a message |
rmdir | To remove or delete empty directory |
shutdown | To shut down system (For superuser only) |
tail | Gives end of file |
tput clear | Clear screen |
tr | Change case of text |
useradd | Add a user account (For superuser only) |
unzip | Uncompress a .zip file |
unix2dos | Convert files from UNIX to DOS |
vi | Edit file |
who | To view users an their activities |
wc | Count no of words, lines and characters |
whatis | Gives command brief in one line |
wall | Address all users (For superusers only) |
usermod | Modify user account (For superuser only) |
zip | Compress multiple files to a single .zip file |
Have you any command to add to this list? Please share in comments.
`watch -n 2 command`: call “command” every 2 seconds. Example: `watch -n 0.5 ps -aux -C java` monitors Java processes