Linux is one of the most powerful and widely used operating systems in the world. It forms the backbone of everything from smartphones and smart devices to web servers and supercomputers.

Popular distributions like Ubuntu, Raspbian, Kali Linux, and Debian make Linux accessible to everyone—from beginners to advanced users.

What makes Linux especially appealing is its flexibility, speed, and open-source nature. Most importantly, knowing how to use the Linux command line unlocks a whole new level of control and efficiency.


➤ 1. File and Directory Management

  • ls → List files and directories.
  • ls -l → List files with details (permissions, owner, size, date).
  • ls -a → Show hidden files (starting with .).
  • pwd → Show the current directory path.
  • cd → Change to a specific directory.
  • cd .. → Move up one directory level.
  • cd / → Go to the root directory.
  • cd ~ → Go to the home directory.
  • mkdir → Create a new directory.
  • rmdir → Remove an empty directory.
  • rm → Delete a file.
  • rm -r → Delete a directory and its contents.
  • cp → Copy a file or directory.
  • mv → Move or rename a file/directory.

➤ 2. Viewing and Editing Files

  • cat → Display file contents.
  • less → View a file with scrolling (q to exit).
  • head → Show the first 10 lines of a file.
  • tail → Show the last 10 lines of a file.
  • tail -f → Continuously display the last lines of a file (useful for logs).
  • nano → Open file in the Nano text editor.
  • vim → Open file in the Vim text editor.

➤ 3. File Permissions and Ownership

  • ls -l → Show file permissions.
  • chmod 755 → Set file permissions (755 = owner can edit, others can only read/execute).
  • chmod u+x → Give execute permission to the owner.
  • chown user:group → Change file owner and group.

➤ 4. Process Management

  • ps aux → Show all running processes.
  • top → Display system resource usage (press q to exit).
  • htop → Advanced process viewer (needs installation).
  • kill → Stop a process by its Process ID.
  • kill -9 → Forcefully stop a process.
  • pkill → Stop a process by name.

➤ 5. Networking Commands

  • ifconfig → Show network interfaces.
  • ip a → Show IP addresses (alternative to ifconfig).
  • ping → Test network connectivity to a host.
  • nslookup → Get DNS info of a domain.
  • wget → Download a file from the internet.
  • curl → Fetch data from a URL (useful for APIs).

➤ 6. Disk Usage and Monitoring

  • df -h → Show available disk space.
  • du -sh → Show size of a directory.
  • free -h → Display memory (RAM) usage.

➤ 7. Searching for Files and Text

  • find /path -name "filename" → Search for a file by name.
  • grep "text" → Search for text inside a file.
  • grep -r "text" → Search for text in all files in a directory.
  • locate → Find a file by name (needs updatedb first).

➤ 8. Archiving and Compression

  • tar -cvf archive.tar → Create a tar archive.
  • tar -xvf archive.tar → Extract a tar archive.
  • tar -czvf archive.tar.gz → Create a compressed tar archive.
  • tar -xzvf archive.tar.gz → Extract a compressed tar archive.
  • zip -r archive.zip → Create a zip archive.
  • unzip archive.zip → Extract a zip archive.

➤ 9. System Logs and Info

  • dmesg → Show system boot logs.
  • journalctl -xe → View system logs.
  • uptime → Show system uptime.
  • uname -a → Show system and kernel details.