DEV Community

Muralidhar M Pala
Muralidhar M Pala

Posted on

10 Real-World ShellGPT Prompts Every Linux Admin Should Know

If you've read my ShellGPT episodes (1, 2, and 3), you already know this isn't hype — it's hands-on. And today, for Sysadmin Sunday, I'm doing something different. No long story, no theory. Just 10 powerful ShellGPT prompts I’ve personally used as a Linux sysadmin — tested in real-world servers, not lab fantasy.

Let’s dive straight in.

1. 🔍 Check System Health

"Check CPU, RAM, disk usage, and top processes in a single-line command."

sgpt "Provide a Bash one-liner to display CPU load, memory usage, disk usage, and top 5 processes."

Image description

2. 🧠 Summarize a Log File

"Scan and summarize the last 100 lines of a syslog or journalctl output."

sgpt "Summarize the last 100 lines of /var/log/syslog to identify any warnings or errors."

Image description

3. 🔐 Audit User Access

"Find all users with sudo access and show last login details."

sgpt "A service is failing with exit code 1. Analyze the output of 'systemctl status ' and suggest a fix."

Image description

4. 📦 Troubleshoot Failing Service

Analyze systemd output and suggest possible fixes.

sgpt "A service is failing with exit code 1. Analyze the output of 'systemctl status ' and suggest a fix."

5. 🧹 Clean Up Disk Space

Suggest safe commands to clean temp files, journal logs, old kernels.

sgpt "Suggest commands to safely clean up disk space on a RHEL system, including temp files and journal logs."

6. 🗂️ Parse and Extract Logs

"Write awk/sed scripts to extract error patterns from log files."

sgpt "Write an awk command to extract all lines with ERROR from /var/log/app.log and count unique errors."

7. 🌐 Identify Open Ports and Their Services

"List all open ports and matching process names."

sgpt "Write a command to list open ports and associated process names in Linux."

8. 🕒 Monitor Real-Time Resource Usage

"Use dstat or vmstat in combination with grep to filter critical data."

sgpt "Create a real-time command using dstat to monitor CPU, disk IO, and network usage."

9. 🧱 Create and Mount LVM

"Walk through creating a volume group, logical volume, and mounting it."

sgpt "Show steps to create a new LVM from /dev/sdb1, format it, and mount to /mnt/data."

10. 🔄 Schedule Automated Backups

"Generate a cronjob to rsync user directories nightly."

sgpt "Write a cronjob that runs rsync daily at 1AM from /home to /backup."

🔗 Want More?

If you liked these prompts, check out the full episodes:

Tried one of these prompts? Let me know in the comments which worked best for your setup. And remember — the real magic is not in knowing, but in using.

Happy Sysadmin Sunday!

Follow me here on Dev.to for more ShellGPT use cases, Linux tips, and sysadmin stories from the trenches.

— Murali Pala

Top comments (0)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.