Friday, August 14, 2015

Useful Linux Commands.

What is "LINUX"

 Linux is an open-source operating system. Linus Torvalds built the core of the operating system, named as kernel (Linux Kernel)  in 1991. Linux has four major parts.
  • The Kernel
  • Supplied programs
  • The shell
  • X

Few commands.

1) cd :- Change your current directory.
 
     (a) cd [file_path]  (go to directory using path)
          eg: cd Documents/Education/


      (b) cd  [..]    (move back one directory)
           eg: cd ..

      (c) cd    (redirect to home)
           eg: cd


2) pwd :-Print current working directory using absolute path.

     eg: pwd


3) mkdir :-  Create directory or directories

       (a) mkdir [directory name] ( create directory in current directory)
            eg: mkdir directory_one
             *** Note: [ls -l] is long listing FILES


       (b) mkdir [directory_1 directory_2] (create more than one directory in current directory)
             eg: mkdir directory_1 directory_2

 
      (c) mkdir [<absolute path>/file_name] (create directory using absolute path)
           eg: mkdir /home/banuka/Documents/Education/directory_abc


4) rmdir :- Delete empty directory

       (a) rmdir [directory_name] (remove empty directory in current directory)
            eg: rmdir  directory_abc

     
       (b) rmdir [<absolute path>/file_name] (remove empty directory using absolute path)
           eg: rmdir /home/banuka/Documents/Education/directory_abc


5) rm -r :Delete nonempty directory

       (a) rm -r [Directory_name]  (remove nonempty directory in current directory)
            eg: rm -r Education


       (b) rm -r [<absolute path>/file_name] (remove nonempty directory using absolute path)
           eg: rm -r /home/banuka/Documents/Education