🧠 Top 5 Intermediate Level Linux Commands πŸ§πŸ’»

Danish TamboliDanish Tamboli
3 min read

These intermediate-level commands will help you manage files, processes, permissions, and more efficiently. Let's dive in! πŸ”§


1. πŸ“‚ rsync – Remote Syncing & Backup Tool

πŸ“¦ What it does:
rsync is a powerful command-line tool to copy and synchronize files/directories between local and remote systems.

πŸ› οΈ Real-life Example:
Backup your project folder to an external drive or a remote server:

rsync -avh /home/user/project/ /mnt/backup/project/

πŸ“Œ Useful Options:

  • -a: Archive mode (preserves permissions, links)

  • -v: Verbose (shows progress)

  • -h: Human-readable format

πŸš€ Pro Tip:
Sync with a remote server using SSH:

rsync -avz /home/user/ user@server:/backup/

2. πŸ” grep – Search Text Using Patterns

πŸ“¦ What it does:
grep searches for specific text or patterns in files β€” great for scanning logs or configuration files.

πŸ› οΈ Real-life Example:
Find all errors in a log file:

grep "ERROR" /var/log/syslog

πŸ“Œ Other Uses:

  • Case-insensitive search: grep -i

  • Show line numbers: grep -n

  • Invert match (show non-matching lines): grep -v

πŸš€ Pro Tip:
Combine with ps to find running programs:

ps aux | grep apache

3. βš™οΈ chmod – Change File Permissions

πŸ“¦ What it does:
chmod lets you change file or folder permissions, controlling who can read, write, or execute files.

πŸ› οΈ Real-life Example:
Make a script file executable:

chmod +x script.sh

πŸ“Œ Permission Values:

  • r = read = 4

  • w = write = 2

  • x = execute = 1

πŸ“Š Numeric Example:

chmod 755 myfile.sh

Means: Owner (7 = rwx), Group (5 = r-x), Others (5 = r-x)


4. πŸ“ˆ du – Disk Usage Analyzer

πŸ“¦ What it does:
du shows how much disk space a file or directory is using.

πŸ› οΈ Real-life Example:
Check which folders are taking up space:

du -h --max-depth=1 /home/user/

πŸ“Œ Useful Options:

  • -h: Human-readable (MB, GB)

  • --max-depth=1: Only top-level folders

πŸš€ Pro Tip:
Combine with sort to list by size:

du -sh * | sort -h

5. πŸ”„ kill – Terminate a Running Process

πŸ“¦ What it does:
kill allows you to stop a process using its Process ID (PID).

πŸ› οΈ Real-life Example:
Stop a program that’s stuck or using too many resources:

kill 1234

(Where 1234 is the PID)

πŸ“Œ Find the PID first:

ps aux | grep firefox

πŸš€ Force Kill:
If the process doesn’t stop:

kill -9 1234

βœ… Summary Table

βš™οΈ CommandπŸ’‘ What It DoesπŸ” Real-World Use
rsyncSync and back up filesBackup local projects to server or drive
grepSearch text with patternsFind "ERROR" lines in log files
chmodChange file permissionsMake scripts executable or restrict access
duCheck disk usageFind what’s using up disk space
killTerminate running processesStop frozen or high-resource programs

🏁 Conclusion

These intermediate Linux commands give you greater control over your system and are essential for developers, sysadmins, or power users. They’re the bridge between basic navigation and advanced system management. 🧰πŸ”₯

Keep practicing, combine them in shell scripts, and soon you’ll be scripting your way through any task like a Linux ninja! πŸ₯·πŸ§


0
Subscribe to my newsletter

Read articles from Danish Tamboli directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Danish Tamboli
Danish Tamboli