15 Must-Know Linux Commands for Junior Systems Engineers
1. Why the CLI Is Your Best Friend
- Speed and Efficiency: Command chaining, piping, and direct text input make the CLI faster than GUIs.
- Precision and Flexibility: Tools like
grep
,awk
, andsed
allow for fine-tuned text processing. - Remote Configuration: CLI tools are ideal for managing remote servers via SSH.
- Scripting and Automation: Bash scripts and cron jobs automate repetitive tasks.
Learn more about the benefits of the CLI in this
in-depth article on Linux command line usage.
3. File and Directory Management Essentials
cp
– Copies files or directories. Usecp -R
for the recursive copy.mv
– Moves or renames files. Example:mv old.txt new.txt
.rm
– Removes files or directories. Always use with caution (e.g.,rm -ri
for interactive deletion).mkdir
– Creates directories. Example:mkdir my_folder
.rmdir
– Removes empty directories.
See this handy Hostinger Linux Commands Cheat Sheet for more details.
4. Working with File Permissions
chmod
– Changes file permissions. Example:chmod 755 script.sh
.chown
– Changes file ownership. Example:chown user:group file.txt
.chgrp
– Changes file group ownership.
For a deeper dive into permissions, read the
GNU Core Utilities documentation on chmod.
5. System Monitoring and Performance Tools
top
andhtop
– Monitor processes and resource usage in real-time.free
– Displays memory usage. Example:free -h
.df
– Reports disk space usage. Example:df -h
.du
– Summarizes directory disk usage. Example:du -sh /path
.
Check out this article on
system monitoring commands for more insights.
6. Managing Processes and Services
ps
– Displays information about running processes. Example:ps aux
.kill
– Terminates a process by its PID. Example:kill 12345
.systemctl
– Manages services on systemd systems. Example:systemctl restart nginx
.service
– Legacy command to manage services on SysV systems.
For more on process management, see the Red Hat blog on essential Linux commands.
7. Networking Commands for Junior Engineers
ifconfig
/ip address
– Displays and configures network interfaces.ping
– Tests connectivity. Example:ping -c 5 google.com
.netstat
/ss
– Lists active network connections.traceroute
– Traces the network path to a destination.nslookup
/dig
– Queries DNS information.
Learn more about networking commands on the
Linux man pages online.
8. Disk and Storage Management
fdisk
– Views and modifies disk partitions. Example:fdisk -l
.lsblk
– Lists block devices and their mount points.mount
andumount
– Mounts and unmounts file systems.blkid
– Displays device UUIDs and labels.
For more details on disk management, visit the
DigitalOcean disk management tutorial.
9. Log Files and Troubleshooting
tail
– Shows the end of files. Example:tail -f /var/log/syslog
for live updates.grep
– Searches text for patterns. Example:grep "error" /var/log/syslog
.journalctl
– Views logs on systemd systems. Example:journalctl -u nginx.service
.
More tips on troubleshooting logs can be found at
Linux Journal’s guide to journalctl.
10. Package Management
- Debian/Ubuntu: Use
apt
:apt update
– Update package listsapt upgrade
– Upgrade packagesapt install package_name
– Install a package
- Red Hat/CentOS/Fedora: Use
yum
ordnf
. - Other tools include
dpkg
,rpm
, andsnap
.
For a complete guide, check out the
DigitalOcean package management tutorial.
11. Archiving and Compression Commands
tar
– Archives and extracts files. Examples:- Create:
tar -czvf archive.tar.gz /path/to/files
- Extract:
tar -xzvf archive.tar.gz
- Create:
gzip
/gunzip
– Compresses and decompresses files.zip
/unzip
– Creates and extracts ZIP archives.
Learn more about archiving with
the GNU tar manual.
12. Remote Server Management
ssh
– Securely connects to remote servers. Example:ssh user@remote_server
.scp
– Securely copies files between systems.rsync
– Synchronizes files/directories efficiently. Example:rsync -avz /local/dir user@remote:/remote/dir
.
For more on remote access, see the
DigitalOcean SSH tutorial.
13. Automation and Scripting Basics
cron
– Schedules recurring tasks. Edit your crontab withcrontab -e
.at
– Schedules one-time tasks. Example:echo "reboot" | at 03:00
.bash scripting
– Write scripts to automate tasks. See the example below:#!/bin/bash # Backup Script Example SOURCE="/var/www/html" DEST="/backup/html-$(date +%F)" mkdir -p "$DEST" rsync -av --delete "$SOURCE" "$DEST" echo "Backup completed on $(date)" >> /var/log/backup.log
For more scripting tutorials, visit the LinuxCommand.org website.
14. Security Basics
sudo
– Executes commands with elevated privileges. Example:sudo apt update
.passwd
– Changes user passwords.ufw
– Simple firewall management on Ubuntu. Example:sudo ufw allow 80
.iptables
– Advanced firewall configuration. Example:sudo iptables -A INPUT -p tcp --dport 22 -j ACCEPT
.
Enhance your security knowledge by reading the Cyberciti.biz guide on Linux security.
15. Useful Shortcuts and Miscellaneous Commands
history
– Shows your command history. Example:history
or repeat a command with!45
.alias
– Creates custom shortcuts. Example:alias ll="ls -alF"
.man
– Displays the manual for commands. Example:man ls
.clear
– Clears the terminal screen.exit
– Ends the terminal session.
For more productivity tips, check out this LifeWire article on Linux shortcuts.
Conclusion
Mastering these 15 essential Linux commands is a vital step in your journey as a systems engineer or administrator. By regularly practicing commands—from navigating directories with cd
and ls
to manage services with systemctl
and configuring network settings—you unlock greater control, efficiency, and flexibility in managing your systems.
Recap:
- Navigation:
ls
,cd
,pwd
- File Management:
cp
,mv
,rm
,mkdir
- Permissions:
chmod
,chown
,chgrp
- Monitoring:
top
,free
,df
,du
- Process Management:
ps
,kill
,systemctl
- Networking:
ifconfig
/ip
,ping
,traceroute
- Disk Management:
fdisk
,lsblk
,mount
- Logs:
tail
,grep
,journalctl
- Package Management:
apt
,yum
, etc. - Archiving:
tar
,gzip
,zip
- Remote Management:
ssh
,scp
,rsync
- Automation:
cron
,at
, scripting - Security:
sudo
,passwd
,ufw
,iptables
- Shortcuts:
history
,alias
,man
Practice these commands daily, build your cheat sheet of aliases, and start automating routine tasks with simple bash scripts. Explore additional resources and join online communities such as the r/linux subreddit to further enhance your skills.
Happy command-line hacking!