Linux Commands of MAN, LS, HELP and CLEAR

 let us continue our discussion with the more Linux commands:

Man  – Man is the short form of Manual. If you want to know more about any command, use Man command.

The Syntax of man command is as follows:

Man [Command Name]

Let say you want to know more about pwd command, type man pwd and hit Enter.

$ man pwd

The following output will come as a result.

Press up and down arrow key to move up and down.

Please press q to come out of MAN command.

Help– Like man command help  is also used to get more details about any other commands.

The syntax used for help  is as follows:

help [Command Name]

e.g.

$help cd

LSLS stands for List Segments. It is one the the Linux Commands,that is used to list all files and folders in any desired directory.

The syntax for ls is as follows:

ls [Options] [Files/Directory path]

Write ls and hit Enter, it will list down all files and directories of the present working directory.

$ls

Now let’s try ls [Option] i.e ls command with some options

  • ls –a – It shows all hidden files and folders in your directory.

      $ls -a

Note: All the files and folders starting with a dot (.) shows represent hidden files.

  • ls –l – It lists the output in more detail. It prints the permission, size and modified date of files and folders.

         $ls –l

        ls –lh – It lists the detailed output in a human-readable format.

        $ls -lh

Here 4.0 K represents the size in KB i.e human readable format.

  • ls –R – This command is used to show the directory-subdirectory structure.

   $ls -R

You can explore more on ls command by merging two or more commands

e.g -you can merge ls –a and ls –h and ls –h command i.e you can use ls –alh

Now let’s try ls [Options] [file/directory path] or simply ls [file/directory path]

  ls [file/directory path]

If you want to see the contents of your Download folder you can simply try below commands.

Note- These commands are case sensitive, so be careful while writing the path.

i)$ls Downloads/

(Run this command when you are working at the home directory of the user, you can check whether you are in the home directory by running pwd command)

ii) $ ls /home/Chandan/Downloads/

(Run this command when you are working at any directory and logged in as any user, as you are passing the exact path of user’s Downloads folder)

iii) $ls ~/Downloads

(Run this command when you are working at any directory and logged in as the user whose Download folders content you want to list down).

Ls commands do not end here, so if you want some more exposure on this you can use the below command

$man ls

Press the key q to quit from MAN.

ClearClear command is used to clear the terminal. If your terminal is filled with too many commands, use clear command to clear the terminal screen.

$ clear

 

Thanks for reading this article.I hope you enjoyed to learn these Linux Commands. We will continue our discussion in my next blog –Linux Command Line Tutorial for Beginners(PartIII)

Please share your valuable comment/feedback in the below comment box, also please feel free to ask any questions.

If you think we helped you or just want to support us, please consider these:-

Connect to us: Facebook | Twitter

You may also like…

Leave a Reply

Your email address will not be published. Required fields are marked *