π§ Top 5 Intermediate Level Linux Commands π§π»


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 = 4w
= write = 2x
= 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 |
rsync | Sync and back up files | Backup local projects to server or drive |
grep | Search text with patterns | Find "ERROR" lines in log files |
chmod | Change file permissions | Make scripts executable or restrict access |
du | Check disk usage | Find whatβs using up disk space |
kill | Terminate running processes | Stop 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! π₯·π§
Subscribe to my newsletter
Read articles from Danish Tamboli directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
