Skip to main content
Linux Commands

Linux commands explained – Part 1

In this tutorial I will explain about some basic Linux commands used to navigate through the file system. If you are new to Linux, I recommend you to go through the following articles to get a better idea of the stuff explained here.

  1. Different file types in Linux
  2. File permission’s and ownership’s
  3. Special permissions (SUID,SGID,sticky bit)
  4. Linux Directory Structure explained
  5. Linux wild cards explained

Linux Commands – Set 1

The first three commands to play with are – pwd (print working directory),ls (list files and directories), and cd (change directory).


PWD command helps you to identify the location of you in the Linux directory structure. I.e, it just prints your present working directory. When log on to a Linux system, the starting directory is always your home directory i.e /home/your_username.

[email protected]:~$ pwd

Please note that this can be changed by the system administrator.


Ls command is used to list the contents of a directory. Check the syntax of this command below.

$ ls [path_to_the_directory]

If we didn’t specify any directory then the current wording directory is assumed.

[email protected]:~$ ls

This doesn’t give us any idea about the type of the files listed. But, please note that ls command comes with a bunch of options/arguments which help us to see the permissions,ownerships,created date,size etc of files. I have explained it in detail in another post.


It is used to change the current directory. I.e, you can move through the directories of your Linux system.

[email protected]:~$ cd Desktop/
[email protected]:~/Desktop$

The above command changes the current working directory to Desktop. You can check it using command pwd.

[email protected]:~/Desktop$ pwd


cd [directory]

Think if you want to change the working directory to /usr/local/src/.

[email protected]:~/Desktop$ cd /usr/local/src/
[email protected]:/usr/local/src$ pwd



Change Current directory to parent directory.

[email protected]:/usr/local/src$ cd ..
[email protected]:/usr/local$ pwd


cd –

Move to the previous working directory.

[email protected]:/usr/local$ cd –



cd without any argument moves the working directory straight to the user’s home directory.

[email protected]:/usr/local/src$ cd
[email protected]:~$ pwd

That’s it. I will explain the next set of Linux commands in another post.

Rate this post


TheGeeksAlive is all about Linux, Server Administration, Web Hosting and other Open Source Technologies.