Linux Commands:
cd:
cd command is used to change the directory
Syntax:
cd FolderName
For Example:
Let’s say I have created 2 folders one is A and another one is B. If I am present in folder A and I want to switch to folder B which is located under the same directory then I can write the above command as.
cd /B
Now We can work in the directory(Folder) B.
pwd
pwd stands for print the current working directory
This command is used to print the current working directory.
For example:
This command usually tells about, in which directory currently you are
/root/Desktop/B
pwd shows us that we are in B Directory
ls
ls command is used to list files or directories
Syntax:
ls
For Example:
When you type ls, then ls will show you all the files or folders that are present inside a particular directory.
you can use commands like
ls /path of file/DirectoryName
The above command will show you all the files and folders inside a particular directory
ls -a
This command is used to see all the hidden files and folders in a particular directory
ls -l
the above command is used to show files along with properties.
Syntax:
ls -l fileName
ForExample:
to show the properties of a file named “intro.log” we can type the above command as:
ls -l intro.log
Hidden Files and folders in Linux:
In Linux dot ( . ) is present before a hidden file.
How to Hide files in Linux?
When you want to hide any file or folder in Linux just put a dot before that file or folder.
For Example:
.file or .folderName