iti
18 April 2025
๐ฅ๏ธ Using Basic Linux Commands for Directory Listing, File and Folder Management, Password, etc.
Linux is a powerful operating system used in servers, desktops, and embedded systems. The terminal or command line interface (CLI) is a key way to interact with Linux. In this section, we will explore basic Linux commands to manage files, directories, and perform other essential tasks.
๐ Introduction to Linux Commands
Linux commands are used to perform various tasks such as listing files, navigating directories, and managing the system. These commands are typed into the terminal, which is an interface that allows users to communicate with the system.
๐งญ Basic Linux Commands
- ls: Lists the files and directories in the current directory.
- cd: Changes the current directory.
- pwd: Displays the current working directory.
- mkdir: Creates a new directory.
- rmdir: Removes an empty directory.
- rm: Removes a file or directory.
- cp: Copies a file or directory.
- mv: Moves or renames a file or directory.
- chmod: Changes file permissions.
- chown: Changes file owner and group.
- cat: Displays the contents of a file.
- man: Displays the manual for a command.
๐ Working with Passwords
Managing user passwords is an important part of system administration. Linux provides commands to change and manage passwords:
1. ๐ ๏ธ Changing Password
- To change your password, use the
passwd
command:
2. ๐ User Management Commands
- adduser: Adds a new user to the system.
- userdel: Deletes a user from the system.
๐ File and Folder Management Examples
1. ๐ Navigating Directories
- To view your current directory:
- To change directories:
- To move to the parent directory:
2. ๐ Creating and Deleting Files and Folders
- Create a new directory:
- Create an empty file:
- Delete a file:
- Delete an empty directory:
๐ Summary
- Linux commands are powerful tools for interacting with the system, and mastering them helps in file management, system administration, and troubleshooting.
- Key Linux commands like
ls
,cd
,mkdir
,rm
, andcp
are essential for working with files and directories. - Commands like
passwd
,adduser
, anduserdel
are useful for managing users and passwords. - Being proficient with Linux commands improves efficiency in managing and operating a Linux system. ๐ป