Basic Linux Commands

                                                         

Hi Friends……


         Learning Linux commands makes our work much easier. I share some important commands in our routine usage……


1. tar command examples :

 Create a new tar archive.

          $ tar cvf archive_name.tar dirname/

Extract from an existing tar archive.

          $ tar xvf archive_name.tar

2. grep command examples :

 Search for a given string in a file (case in-sensitive search).

      $ grep -i “the” demo_file


3. shutdown command examples :

   Shutdown the system and turn the power off immediately.

  # shutdown -h now

Shutdown the system after 10 minutes
 
  # shutdown -h +10

Reboot the system using shutdown command.

    # shutdown -r now

Force the filesystem check during reboot.

  # shutdown -Fr now

4. ps command examples

ps command is used to display information about the processes that are running in the system.

While there are lot of arguments that could be passed to a ps command, following are some of the common ones.

To view current running processes.

$ ps -ef | more

To view current running processes in a tree structure. H option stands for process hierarchy.
$ ps -efH | more

5. top command examples

top command displays the top processes in the system ( by default sorted by cpu usage ). To sort top output by any column, Press O (upper-case O) , which will display all the possible columns that you can sort by as shown below.


To displays only the processes that belong to a particular user use -u option. The following will show only the top processes that belongs to oracle user.
  $ top -u oracle