Spiga

10 Linux Commands You Use More Offen

cat


cat tells the system to "concatenate" the content of a file to the standard output, usually the screen. If that file happens to be binary, the cat gets a hairball and the output can be a bit ugly. Typically, this is a noisy process as well. what is actually happening is that the cat command is scrolling the characters of the file, and the terminal is doing all it can to interpret and display the data in the file. The interpretation can include the character used to create the bell signal, which is where the noise comes from. the cat command have the following format.

  #   cat filename

cd


cd stands for change directory. You will find this command extremely useful. There are three typicla ways you can use this command
  • cd .. :    Move one directory up the directory tree.
  • cd - :   Moves to your home directory from wherever you currently are.
  • cd directory name :   Change to a specific directory. This can be directory relative to your current location or can be based on the root directory by placing the forward slash(/) before the directory name.

cp


cp command is the abbrevation for copy; therefore , this command enables to copy objects. For eg : to copy the file from file1 to file2, issue the following command.

  #   cp file1 file2

find


The find command will look in whatever directory you tell it to, as well as subdirectories under that directory, for that file specified. In the following example, the find command searches for files ending with .pl in the current directory.

  #   find *.pl

grep


The grep (global regular expression parse) command searches the object you specify for the text that you specify. The syntax for the following command.

  #   grep text file

ls


The ls command lists the contents of the directory. The format of the output is manipulated with options. In the following example, the ls command, with no options, list all unhidden files (the file that begin with a dot is a hidden file) in a alphabetical order, filling as many column as will fit in the window.

  #   ls

more


more is a filter for paging through text one screen at a time. This command can only page down through the text, as apposed to less, which can page both up and down through the text.

rm


rm is used to delete specified files. with the -r option (Warning: This can be dangerous!), rm will recursively remove files. therefore if as root, when you type rm -r , all your files will be gone. By default, rm command will not remove directories.

tar


tar is an archiving program designed to store and extract files from an archive file. This tarred file (called as tar file) can be archived to any media including a tape drive and a hard disk. the syntax for the tar command as follows

  #   tar action optional functions file(s)/director(ies).

vi


vi is an extremely powerful text editor (not to be confused with a word processor). Using vi,you can see your file on the screen (this is not the case with a line editor, for example), move from point to point in the file, and make changes. But that's where the similarities end. Cryptic commands, a frustrating user interface, and the absence of prompts can all drive you up a wall. Still, if you focus on a few basics, you'll get the job done.

If i have missed any Linux command that fit in the above list, please let me know.

3 comments:

  Anonymous

July 10, 2008 at 8:16 AM

Here is the one used most often...
ln -s /linux /microsoft-patents

  Anonymous

July 13, 2008 at 11:58 PM

Suresh,

I'm a Linux administrator and been using Linux for a very long time. I'm glad that you are posting some basics of Linux to give some exposure to a wider group.

Ramesh
The Geek Stuff

  Suresh Kumar A

July 14, 2008 at 2:18 AM

i am really very happy to hear postive feedback regarding my post.Thanks a lot. i am looking forward to post nice articles that will favor to the online users and developers.