Linux Basic Commands
Completion requirements
Linux provides a set of powerful and commonly used commands to interact with the system efficiently. The
Linux provides a set of powerful and commonly used commands to interact with the system efficiently. The cd command is used to change directories, while ls lists the contents of a directory. To clear the terminal screen, the clear command is used. The mkdir command helps create new folders, and pwd shows the current working directory. The rm command is used to remove files or directories, and touch is used to create empty files. To edit or view text files directly in the terminal, vi is a powerful editor. The / symbol represents the root directory, which is the top level of the Linux filesystem. To manage users, adduser is used to create a new user, and userdel is used to delete an existing one. The history command displays a list of previously executed commands, allowing users to track or reuse them easily. These commands form the foundation for working effectively in a Linux environment.
4. / (Root Directory)
/ (Root Directory) in Linux
In Linux, / is called the root directory.
It is the top-most directory in the Linux filesystem. All other files and folders are stored under this root.
🔹 Think of it like:
A tree 🌳 —/is the root and everything else (like/home,/etc,/bin, etc.) are branches.
🔹 Example:
Type this in terminal:
cd /pwd
Output:
/
👉 This means you are now in the root directory.
🔹 Listing contents of /:
ls /
You may see folders like:
bin boot dev etc home lib media mnt opt proc root run sbin tmp usr var
Each of these has a special purpose. For example:
-
/home→ User folders -
/etc→ Configuration files -
/bin→ Basic Linux commands -
/var→ Logs and variable data
🔹 Visual Structure:
/├──bin├──etc├──home│ └──ashwin├──var├──usr└──tmp
Try with Linux Pratice