Linux Command Line: A Beginner's Tutorial
Linux Command Line Tutorial
1. Introduction
The command line is a powerful tool for interacting with your Linux system. It allows automation, file
management, software installation, and much more.
2. Navigation Commands
- pwd: Print the current directory path
- cd [dir]: Change to the specified directory
- ls: List files in the current directory
- tree: Show directory structure
3. Working with Files
- touch file.txt: Create a file
- cp file1 file2: Copy file1 to file2
- mv old.txt new.txt: Rename or move files
- rm file.txt: Delete a file
4. Viewing and Editing Files
- cat file.txt: Display file contents
- nano file.txt: Open file in Nano editor
- less file.txt: Scrollable file viewer
5. Permissions and Ownership
- ls -l: Show file permissions
- chmod +x script.sh: Make a script executable
- chown user:group file.txt: Change file ownership
6. Package Management (Debian-based)
- sudo apt update: Update package lists
- sudo apt install [pkg]: Install a package
- sudo apt remove [pkg]: Remove a package
Linux Command Line: A Beginner's Tutorial
7. Process Management
- top or htop: Show active processes
- ps aux | grep [name]: Search for a running process
- kill [PID]: Stop a process by ID
Conclusion:
Mastering the Linux command line increases productivity and enables deeper system control, which is
essential for developers and engineers.