Home » Tips » Basic Linux Commands for files and folders
basic linux commands for files and folders

Introduction: Linux is a free and open-source operating system just like Windows and Mac OS. We can use Linux on computers and servers.

Summary: Basic Linux commands for files and folders I choose this topic Because so many users don’t know about the simple command of Linux. In this post, I am going to show you some basic command related to folder and file so that you can easily manage them. We need Shell or Terminal to execute these commands. We can do complex things very easily using these simple commands.
So Let’s Start,

pwd: When you open the terminal, you’re in the home directory of your user. To know the present directory, you can use “pwd“. This full form of this is the present working directory.

cd: stands for change directory. If you want to go from one folder to another you need to write cd folder name. For example, if you in Test1 directory and want to go directory Test2 simply write:

If you want to jump back form any folder just use below command:

ls: ls command is used to list out files and folder in any directory or folder. You simply need to write ls.

touch: Sometimes we need to create a file in the folder. The touch create a new file it can be any file like .txt or .php
any type of file you can create by touch command. For example, if we need a text file in Test1 folder just go in this
with the help of cd then use below command:

After running above command that checks with ls you a text file created in your folder.

mkdir: Stands for make directoryIt works similarly like touch but Its job is kinda different it will create new directory into your present folder. For example, in below command:

rm: Stands for removeThe rm command used t remove files and folders. To remove directory need to use rm -r  because of rm command to able to remove the directory.

chmod: Sometimes you need to perform above action with files and folders but you can’t do that action because of permission issue. You can give permission to any file and folder according to your requirement. For example, you can give permission chmod 777 -R for reading, write and execute.

In the above example, I am giving permission to my new.txt.
That’s all! ?
Please comment below if you have any query or you want to know about more command.  ?

Top 7 commands of git you must learn

Back to top