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.
3. cd
cd Command in Linux
cd stands for Change Directory.
It is used to navigate between folders in the Linux file system.
🔹 Basic Syntax:
cd [directory_path]
cd /etc/sysconfig
🔹 Common Examples:
-
Go to a specific directory
cd /etc/sysconfig/network-scripts
👉 Moves you to the Documents folder.
-
Go to your home directory
cd
or
cd ~
👉 Takes you to your user's home directory, like /home/ashwin.
-
Go back to the previous directory
cd ..
👉 Takes you to the previous directory you were in.
-
Navigate using relative path
cd /var/log
👉 Moves into /var/log from your current location.
🔹 Check Your Location:
Use pwd to confirm where you are after using cd.
Try with Linux Practice