HomeProjects
1+ Years Experience

Linux Command Line: The Complete Mastery Guide

LinuxJan 16, 202630 min read

The Linux command line (Terminal) is one of the most powerful tools in computing. Whether you are a developer, system administrator, DevOps engineer, or ethical hacker, mastering Linux commands is essential. This guide covers everything you need, from basic commands to advanced system management.

Table of Contents

1. What is the Linux Command Line?

The Linux Command Line (CLI) allows you to interact with the operating system using text-based commands instead of a graphical interface. It is the gold standard for performance, precision, and automation.

Speed

Outperform any GUI

Automation

Bash & Shell Scripting

Cloud

Standard for Server Mgmt

Security

Granular System Control

2. Terminal Basics

Command Structure:

bash
command [options] [arguments]

Example: List files in long format

bash
$ ls -l /home/user

3. File & Directory Commands

Navigation & Listing

bash
$ pwd          # Print working directory
$ ls           # List files
$ ls -la       # List all including hidden
$ cd folder    # Change directory
$ cd ..        # Go back

Creating & Managing

bash
$ touch file.txt             # Create empty file
$ mkdir folder               # Create folder
$ cp file1 file2             # Copy file
$ mv oldname newname         # Rename/Move
$ rm -rf folder              # ⚠ Delete folder recursively

4. File Viewing & Editing

bash
$ cat file.txt        # Output entire file
$ head -n 5 file.txt  # First 5 lines
$ tail -f log.log     # Follow log file in real-time
$ nano file.txt       # Simple text editor
$ vim file.txt        # Advanced text editor

5. Permissions & Ownership

Linux security is built on permissions (Read, Write, Execute).

bash
$ chmod +x script.sh       # Make script executable
$ chmod 755 file.txt       # Set specific permissions
$ chown user:group file    # Change owner and group

8. Networking Commands

bash
$ ping google.com      # Check connectivity
$ ip a                 # Show IP addresses
$ curl -I google.com   # Fetch HTTP headers
$ wget url             # Download file

9. Process Management

bash
$ top                  # Monitor system resources
$ ps aux               # List all running processes
$ kill -9 1234         # Force kill process by PID
$ pkill process_name   # Kill by name

10. Disk & System Information

bash
$ df -h      # Disk space usage (human readable)
$ du -sh .   # Total size of current directory
$ free -h    # Memory (RAM) usage
$ uptime     # System run time

11. Package Management

bash
# Debian/Ubuntu
$ sudo apt update && sudo apt install git

# Red Hat/CentOS
$ sudo yum install git

15. Linux Command Cheat Sheet

CommandDescription
lsList files
cdChange directory
pwdCurrent directory
cpCopy files
mvMove files
rmDelete files
chmodChange permissions
chownChange owner
grepSearch text
findFind files
tarArchive
topProcess monitor
dfDisk usage
freeMemory
sshRemote login
Root

Conclusion

This guide is your foundation for Linux mastery. The best way to learn is by doing—open your terminal, try these commands, and explore the system. As you get comfortable, you'll find the CLI far more efficient than any graphical tool!

Have an idea?

Let's Connect

Copyright © 2025 Bibek Shah