Linux Basic Commands Every User Should Know (Cheat Sheet)

🔴 Here is some of basic Linux commands with explanation: 🔴 

✳️ pwd command

🔹 Use the pwd command to find out the path of the current working directory that(folder) you’re in. The command will return an absolute path. 

✳️ cd command

🔹 To navigate through the Linux files and directories, use the cd command. 
It requires either the full path or the name of the directory, depending on the current working directory that you’re in.
🔹 Let’s say you’re in /home/hackerzhome/Documents and you want to go to Photos, a subdirectory of Documents. To do so, simply type the following command: "cd Photos".
🔹 Another scenario is if you want to switch to a completely new directory, for example, /home/hackerzhome/Movies. In this case, you have to type cd followed by the directory’s absolute path: cd /home/hackerzhome/Movies.
🔹 Use cd .. (with two dots) to go to the previous directory

✳️ ls command

🔹 The ls command is used to view the contents of a directory. By default, this command will display the contents of your current working directory.
🔹 If you want to see the content of other directories, type ls and then the directory’s path. For example, enter ls /home/hackerzhome/Documents to view the content of Documents.

✅ There are variations you can use with the ls command:
👉 ls -R will list all the files in the sub-directories as well
👉 ls -a will show the hidden files
👉 ls -al (or) ls -l will list the files and directories with detailed information like the permissions, size, owner, etc.

✳️ mkdir command

🔹 Use mkdir command to make a new directory — if you type **mkdir hackerzhome** it will create a directory called 'hackerzhome".

✳️ rmdir command

🔹 If you need to delete a directory, use the rmdir command. However, rmdir only allows you to delete empty directories.

✳️ rm command

🔹 The rm command is used to delete directories and the contents within them. If you only want to delete the directory — as an alternative to rmdir — use rm -r.

Post a Comment

© HackwithParesh. All rights reserved. Distributed by ASThemesWorld