Tuesday, April 14, 2009

Basic Unix Commands



UNIX is "Simple"!. If you are familiar with DOS (disk operating system used on PC's) you will find UNIX very familiar. The main difference is that each UNIX file has an owner and a group that it belongs to, as well as a set of permissions which determine who is allowed to read, alter or delete, or execute the file.

Unix provides hundreds of useful commands for all sorts of purposes, but it is sometimes difficult to find the specific command you are looking for. The total number of Unix commands is immense. No normal user or system administrator would ever need to know them all.
This little table will show you just what you need to get started on your own unix shell account ( if you haven't had one yet, try to find it in the list of Free unix shell providers ). Not all of these are actually part of UNIX itself, and you may not find them on all UNIX machines.
In this box, I will put only Bash shell commands, as all other major shells can now be considered obsolete.

Two conditions you should always keep in your mind in order to be good "Unixer", are :


  1. Unix is case sensitive. That is, there's a difference between upper and lower case characters. The command "ls" will list all files in your directory. If you try to type it as "LS", you'll get an error message.

  2. Always Use the `man` command to get more informations about any of these commands. For example, to learn more about "ls" command then type "man ls".


CommandDescription
manDisplay the reference manual pages
pwddisplay current directory and path
lslist contents of directory (equivalent of DOS DIR)
cdChange working directory
mkdirMake a directory
rmdirRemove directories
cpCopy files (equivalent of DOS command COPY)
rmRemove (delete) files
fileDetermine file type
mvMove and rename files
viText editor
cmpCompare two files
lnMake a file link
findWalk a file hierarchy
passwdChange password
whichLocate a program file in the user's path
whereisLocate programs
gcc, g++GNU project C and C++ Compiler
gdbThe GNU Debugger
lessView the contents of a text file
diffFind differences between two files
chmodChange file modes
ispellInteractive spelling checker
biffBe notified if mail arrives and who it is from
lprPrint a file
lpqShow the print queue
ftpTransfer a file to another Unix system
chmodChange file modes
quotaDisplay disk usage and limits
aliasCreate a command alias
unaliasDelete a command alias
exportSet an environment variable
scriptRecord your terminal session to a file
bgSend a job to the background
fgBring a job to the foreground
jobsdisplay a list of current jobs
psShow the status of processes
killStop a running processes
historyDisplay a list of recent commands
logoutend terminal session


Tips & Info :


If the BackSpace key doesn't backspace, try the Delete key, the most common key for fixing types. This key deletes the most recent character you typed, and in most cases removes it from the screen. Unfortunately this key is the most complex, because there is confusion about which key and ASCII code should be used.

0 comments:

Post a Comment