Shehab Ali

System Administrator

IT Administrator

Security Analyst

Shehab Ali

System Administrator

IT Administrator

Security Analyst

Blog Post

Top 8 Commands Every SysAdmin Should Know in Linux and PowerShell

Top 8 Commands Every SysAdmin Should Know in Linux and PowerShell

Intro:

Whether you’re managing Linux servers, Windows-based infrastructure, or both, mastering the command line is a fundamental skill for any system administrator. While graphical tools are helpful, there are countless tasks—especially in automation and troubleshooting—that are simply faster and more powerful at the shell level.

In this article, we’ll break down eight essential commands—four from Linux (Bash) and four from PowerShell—that every sysadmin should know and use regularly.


Linux Command Line Essentials

1. top

View real-time CPU, memory, and process usage.

Use it to identify resource-hogging processes or troubleshoot performance issues:

2. rsync

Efficient file transfer and backup utility.

Example for syncing directories:

rsync -avz /source/ /destination/

3. journalctl

Query and display systemd logs, essential for service diagnostics:

journalctl -xe

4. grep

Search inside files and logs—great for finding error messages or keywords:

grep "error" /var/log/syslog

PowerShell Essentials

5. Get-Service

List, filter, or manage services on a local or remote machine:

Get-Service | Where-Object {$_.Status -eq "Running"}

6. Test-Connection

Ping replacement for checking host connectivity:

Test-Connection -ComputerName google.com -Count 4

7. Get-EventLog

Read event logs for diagnostics and troubleshooting:

Get-EventLog -LogName System -Newest 20

8. Get-Process

View process info with CPU/memory stats:

Get-Process | Sort-Object CPU -Descending | Select-Object -First 10

Bonus Tip: Combine Commands in Scripts

Both Bash and PowerShell support scripting, allowing you to chain these commands into automated workflows. For example, using cron on Linux or Task Scheduler on Windows, you can automate cleanup, backups, health checks, and reporting.


Final Thoughts:

Command-line proficiency isn’t just about memorization—it’s about efficiency and control. These eight commands represent the foundation of a responsive, capable system administrator. The more fluent you become at using them, the faster you’ll be at diagnosing problems, deploying changes, and supporting complex infrastructure—whether Linux or Windows based.

Tags: