DEV Community

Sivakumar
Sivakumar

Posted on

Your Guide to Basic Linux Commands Day01

  Sometimes , It is really confusing on where to begin with Linux and its commands in general. Today I am going to share how I begin my journey .
Enter fullscreen mode Exit fullscreen mode

man

  The simplest command you can start from is by using man command where **man** refers to manual . This command can show the definitions , types or switches of other commands , files etc.
Enter fullscreen mode Exit fullscreen mode

eg: man man , man ls

pwd

   The next command that will help you with your everyday activity will be the **pwd** command. This command shows you the current working directory or where you are working in the terminal.
Enter fullscreen mode Exit fullscreen mode

eg: pwd

ls

   This command is one of the easiest yet satisfying command . i.e **ls** , It will show all the files that is the directory or folder you are currently in.
Enter fullscreen mode Exit fullscreen mode

eg:ls
Here we will introduce the concept of switches(-), This will allow you to modify the base command into other predefined choices to show other outputs. Such switches for the ls commands are

  • ls -a= allows you to see hidden files in the directory.
  • ls -l= shows the files in long listing order.
  • ls -lh= -h switch in general shows contents in human readable format. Using it with -l(or -lh)shows long listing in readable format.

cd

   The following command will be your primary way of navigating forward and backward from the linux terminal. In Linux , Everything is considered as a file and you can find anything in the format as a file hiding somewhere in some directories you cannot figure out.

  There are two concepts in navigating through all these files. Absolute path and relative path. When you type a path
Enter fullscreen mode Exit fullscreen mode

starting with a slash (/), then the root of the file tree is assumed. If you don't start your path with a slash, then the current directory is the assumed as the starting point.eg: /home/Documents(absolute path), New_Folder/Images(Relative path)

   Therefore by using the **cd** command , you can go to the path we mentioned above and access the files in those directories.
Enter fullscreen mode Exit fullscreen mode

eg:cd Documents
The other types for the cd commands are

  • cd -~ = This is a shortcut to get you back to your home directory
  • cd .. = This takes you back to your parent directory or one folder back step.
  • cd - = This allows you to go back to the previous directory where you were working on

Wrapping Up

These Commands are pretty easy to implement and some of them will work regardless whether it is windows or linux(no experience with mac unfortunately).

Try the man command for these commands since there are so many switches for all these commands and so much to learn. So, try working them out on your own :)

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.