Saturday 6 October 2012

GETTING STARTED WITH LINUX - PART 2

                  In linux, terminal command line is the most powerful tool using which we can accomplish almost everything you need to do. In ubuntu 10.04 and 10.10 you can find the terminal  in
   Applications menu -> Accessories -> Terminal
In later versions just search for "terminal" in the dash or use the keyboard shortcut  "Ctrl + Alt + T".terminal its similar to the command prompt in windows.

Commonly used terminal commands :

1) ls : This command is used to list the content of the specified directory.
General format is,
                                ls   [-option]   <directory_name>

for example, "ls -a" shows all contents in the current directory and "ls -al" shows all the files in the long format.


2) mkdir : This mkdir ( make directory) command is used to make or create new directories.
General format is,
                                mkdir <directory_name>
for example, the command "mkdir new_folder" creates a new directory inside the current directory


3) rmdir : This rmdir( remove directory) command is used remove or delete the specified directories. a directory should be empty before removing it.
General format is,
                               rmdir <directory_name>

4) cd : cd( Change Directory) command is used to change the current working directory to a specified directory.
General format is ,
                               cd <directory_name>

5) pwd :  pwd(print working directory) command displays the full pathname for the current working directory.

6) sudo : sudo commands provides administrative privileges to the operation being performed

7) cp : cp(copy) command is used to copy the content of one file into another. If the destination is an existing file, the file is overwritten; if the destination is an existing directory, the file is copied into that directory.
General format is,
                                 cp [-options] <source-file> <destination-file>

8) wc : This command is used to display the number of lines, words and characters of information stored on the specified file.
General format is,
                                 wc [-options] <filename>

9) cmp : The cmp ( compare) command is used to compare two files.
General format is ,
                                  cmp <filename1>   <fileneame2>

10) du : This du ( Disk Usage) command reports the disk spaces that are consumed by the files in a specified directory, including all its sub-directories.
General format is ,
                                   du [-options] <directory_name>




Installing an application in terminal:

Now lets see how to install applications using terminal in ubuntu.  For the sake of demonstration lets try to install pidgin which is a multi messenger application for linux

1) open terminal, you'll see something like this
                 
                                 user@computer:~$
2) enter "sudo apt-get install pidgin"
             
                                 user@computer:~$ sudo apt-get install pidgin

3) terminal will now ask for the user password to install the application, enter password and enter "y" to install the application.

                        If you enjoyed this post, I’d be very grateful if you’d help it spread by emailing it to a friend, or sharing it on Twitter or Facebook. Thank you!





No comments:

Post a Comment