B2B ENTERPRISE: Authorized IT Distributor & SaaS Developer | Request a Corporate Account Today
Hashtag Electronics Tech Toolkit

25+ Essential Windows & Mac Commands Every Computer User Should Know in 2026

A practical guide to diagnosing, repairing and understanding your computer using built-in Windows and macOS tools.

Published 23 August 2026 · By Hashtag Electronics · Johannesburg

Your laptop suddenly feels painfully slow. Windows starts behaving strangely. Your Wi-Fi says it is connected, but nothing will load. A program refuses to open. Your computer keeps crashing. Or perhaps you're the person everyone calls when their PC stops working.

Before reinstalling Windows, resetting your Mac, downloading a collection of questionable "PC repair" programs or assuming that your computer needs to be replaced, there are powerful diagnostic and repair tools already built into your operating system.

Some of them have been around for decades. And they are still incredibly useful.

Windows gives us tools such as SFC, DISM, CHKDSK, IPCONFIG, PING, TRACERT, NETSTAT, TASKLIST and POWERCFG. macOS has an equally powerful collection of utilities accessible through Terminal, including tools for network testing, process management, DNS troubleshooting, file-system inspection and system diagnostics.

Whether you're a complete beginner, a hobbyist who enjoys fixing computers, an IT student, a help-desk technician or an experienced IT professional who simply needs a reminder of that command you haven't used in five years, bookmark this guide.

Welcome to the Hashtag Electronics Tech Toolkit.

On this page

  1. CMD, PowerShell and Terminal
  2. Windows repair commands (SFC & DISM)
  3. Hard drive & SSD troubleshooting
  4. Windows network commands
  5. Process & system commands
  6. Laptop battery diagnostics
  7. Wi-Fi troubleshooting
  8. Useful Mac Terminal commands
  9. Real troubleshooting example
  10. Command cheat sheet
  11. FAQ

Before We Start: CMD, PowerShell and Terminal Aren't Quite the Same Thing

On Windows, you'll commonly encounter two command-line environments:

Many traditional Windows commands work in both. On a Mac, you'll generally use Terminal, which gives you access to the Unix-based command line underneath macOS.

How to open Command Prompt as Administrator

  1. Open Start.
  2. Search for Command Prompt or cmd.
  3. Right-click Command Prompt.
  4. Select Run as administrator.
  5. Approve the User Account Control prompt.

You can also search for Terminal or PowerShell and select Run as administrator. When this article says elevated Command Prompt, it means Command Prompt running with administrator privileges.

How to open Terminal on a Mac

Press Command + Space, type Terminal, then press Return. You can also find Terminal under Applications → Utilities → Terminal.

A quick warning: Command-line tools are powerful. Don't blindly paste commands from random websites into an Administrator Command Prompt, PowerShell window or macOS Terminal. Some commands can modify operating-system settings, permissions, partitions and files. The commands in this guide have been selected primarily for diagnostics, troubleshooting and legitimate system repair, but always read what a command does before running it.

Now let's fix some computers.

PART 1: WINDOWS REPAIR COMMANDS

1. SFC /SCANNOW — The Windows Command Everyone Should Know

Let's begin with one of the most useful Windows repair commands:

sfc /scannow

SFC stands for System File Checker. Windows contains thousands of protected system files. If some become corrupted, damaged or incorrectly modified, Windows can begin behaving strangely — features not opening, unexplained error messages, applications crashing, Start menu problems, missing system components or general instability.

SFC scans protected Windows system files and attempts to replace corrupted versions with healthy copies.

How to run SFC: Open Command Prompt as Administrator and enter:

sfc /scannow

The scan can take some time. You may receive messages such as "Windows Resource Protection did not find any integrity violations" or "Windows Resource Protection found corrupt files and successfully repaired them." Sometimes SFC can't repair everything — that's when DISM helps.

2–4. DISM — Repair the Windows Image Itself

DISM stands for Deployment Image Servicing and Management. SFC repairs Windows system files; DISM can help repair the Windows component store that Windows may rely on when performing those repairs.

Start with CheckHealth:

DISM /Online /Cleanup-Image /CheckHealth

Deeper scan:

DISM /Online /Cleanup-Image /ScanHealth

Repair:

DISM /Online /Cleanup-Image /RestoreHealth

An internet connection may be required in some repair scenarios. Once DISM completes successfully, run sfc /scannow again.

Useful Windows repair sequence: ScanHealth → RestoreHealth → sfc /scannow → restart and retest. This isn't a magic cure for every Windows problem, but it's an excellent place to start when Windows itself appears corrupted.

PART 2: HARD DRIVE AND SSD TROUBLESHOOTING

5. CHKDSK — Check Your Drive for File-System Problems

chkdsk C:

A commonly encountered repair version is:

chkdsk C: /f

The /f parameter tells CHKDSK to fix file-system errors it finds. Because Windows is normally running from C:, Windows may ask whether you'd like to schedule the check for the next restart.

Important: CHKDSK is useful, but it is not the same as checking the physical health of an SSD or hard drive. Software cannot repair physically damaged storage hardware. If a drive is failing physically, prioritise protecting important data.

PART 3: WINDOWS NETWORK TROUBLESHOOTING COMMANDS

6. IPCONFIG

ipconfig
ipconfig /all

For an IT technician, ipconfig /all is often one of the first commands worth running when diagnosing a Windows network problem.

7. IPCONFIG /FLUSHDNS

ipconfig /flushdns

Windows caches DNS information. Sometimes stale cached information contributes to connectivity issues.

8. IPCONFIG /RELEASE and /RENEW

ipconfig /release ipconfig /renew

9–10. PING

ping 8.8.8.8 ping google.com ping 8.8.8.8 -t

Continuous ping (-t) is useful for spotting intermittent connectivity. Press Ctrl + C to stop.

Troubleshooting sequence: ping 127.0.0.1 → ping gateway → ping 8.8.8.8 → ping google.com. If you can ping an IP but cannot resolve a hostname, DNS is a strong suspect.

11. TRACERT

tracert google.com

12. NSLOOKUP

nslookup google.com nslookup google.com 8.8.8.8

13. NETSTAT

netstat -ano

Match a PID to a process with tasklist | findstr 6240.

PART 4: WINDOWS PROCESS AND SYSTEM COMMANDS

14–15. TASKLIST & TASKKILL

tasklist tasklist | findstr chrome taskkill /IM notepad.exe taskkill /F /IM notepad.exe taskkill /PID 1234

16–18. SYSTEMINFO, HOSTNAME, WHOAMI

systeminfo hostname whoami whoami /all

PART 5: LAPTOP BATTERY DIAGNOSTICS

19. POWERCFG /BATTERYREPORT

powercfg /batteryreport

Compare Design Capacity with Full Charge Capacity to understand how much capacity the battery has lost over time.

20–21. POWERCFG /ENERGY and /SLEEPSTUDY

powercfg /energy powercfg /sleepstudy

PART 6: WI-FI TROUBLESHOOTING

netsh wlan show interfaces netsh wlan show drivers

PART 7–9: FILE COMMANDS, FINDSTR & TECHNICIAN ESSENTIALS

Useful everyday CMD commands: dir, cd, cls, mkdir, tree /f, and filtering with findstr (e.g. ipconfig /all | findstr DNS).

Core technician toolbox: sfc /scannow, DISM /Online /Cleanup-Image /RestoreHealth, ipconfig /all, ipconfig /flushdns, ping, tracert, nslookup, netstat -ano, tasklist, systeminfo, whoami /all, powercfg /batteryreport.

PART 10: USEFUL MAC TERMINAL COMMANDS

macOS sits on top of a Unix-based foundation. Terminal gives users and technicians access to a serious collection of diagnostic tools.

Navigation & system info

pwd ls -la cd Documents clear sw_vers system_profiler SPHardwareDataType

Network

ping -c 4 google.com ifconfig ipconfig getifaddr en0 route -n get default dig google.com dig +short google.com nslookup google.com

Processes & storage

top ps aux | grep Safari uptime df -h du -sh ~/Downloads softwareupdate -l

PART 11: A REAL TROUBLESHOOTING EXAMPLE

Complaint: "The Wi-Fi is connected, but the internet doesn't work."

  1. ipconfig /all — sensible IP, gateway, DNS?
  2. ping 127.0.0.1 — local TCP/IP stack
  3. Ping the gateway
  4. ping 8.8.8.8 — internet by IP
  5. ping google.com — name resolution
  6. nslookup google.com
  7. ipconfig /flushdns if appropriate
  8. tracert google.com if needed

That's the difference between guessing and troubleshooting.

PART 12–13: When Windows Feels Corrupted — and When Commands Won't Help

Common sequence for suspected Windows corruption: DISM CheckHealth → ScanHealth → RestoreHealth → sfc /scannow → restart.

A command can repair software. It cannot solder a broken charging port, replace failing NAND, repair damaged RAM, replace a swollen battery, clean years of dust, or fix liquid corrosion. Know when to stop troubleshooting software and start investigating hardware.

PART 14: COMMAND CHEAT SHEET

Windows System Repair

sfc /scannow DISM /Online /Cleanup-Image /CheckHealth DISM /Online /Cleanup-Image /ScanHealth DISM /Online /Cleanup-Image /RestoreHealth chkdsk C: /f

Windows Networking

ipconfig /all ipconfig /flushdns ipconfig /release ipconfig /renew ping google.com ping google.com -t tracert google.com nslookup google.com netstat -ano netsh wlan show interfaces

Windows Diagnostics

systeminfo tasklist whoami /all hostname powercfg /batteryreport powercfg /energy

macOS Terminal

pwd ls -la sw_vers system_profiler SPHardwareDataType ping -c 4 google.com ifconfig route -n get default dig google.com df -h ps aux top uptime softwareupdate -l

PART 15–16: Where Beginners and Technicians Should Start

Five commands a beginner should learn first (Windows):

  1. sfc /scannow
  2. ipconfig /all
  3. ping google.com
  4. ipconfig /flushdns
  5. powercfg /batteryreport

Five reminders for IT technicians: DISM /Online /Cleanup-Image /RestoreHealth, netstat -ano, whoami /all, powercfg /batteryreport, nslookup.

PART 17: Learn to Diagnose, Not Just Copy Commands

Being good at computer repair isn't about memorising hundreds of commands. It's about understanding why you're running them. A command is simply a tool used to answer a question.

Need Professional Computer or Laptop Assistance?

Some computer problems can be solved with a command. Others need an experienced technician. Hashtag Electronics provides professional technology support for individuals and businesses in Johannesburg and beyond — computer and laptop repairs, electronics repairs, IT support and related services.

Phone: +27 67 004 3586 · Email: [email protected]

Book a Repair   Contact Us

Frequently Asked Questions

What is the best CMD command to repair Windows?

Two of the most useful built-in tools are SFC and DISM. A common sequence is DISM /Online /Cleanup-Image /RestoreHealth followed by sfc /scannow.

Is SFC /scannow safe?

SFC is a built-in Microsoft utility commonly used to check protected system files. Back up important data before substantial troubleshooting.

Should I run DISM or SFC first?

If Windows corruption is suspected, DISM can check and repair the Windows image before running SFC.

How do I check my laptop battery health in Windows?

Run powercfg /batteryreport and compare Design Capacity with Full Charge Capacity.

How do I clear DNS cache in Windows?

Open Command Prompt and run ipconfig /flushdns.

Can these commands damage my computer?

Diagnostic commands are generally low-risk when used correctly, but administrator/root-level commands can make significant changes. Never run a command you don't understand. Be especially careful with partitioning, formatting, deletion, permissions or boot configuration.

Final thought: Computers become much less mysterious once you learn how to ask them the right questions. Sometimes that question is sfc /scannow. Sometimes it's ping 8.8.8.8. And sometimes the answer is: "This isn't a software problem at all."

Bookmark this page. Come back when you need it. Every Sunday we'll add another practical guide to the Hashtag Electronics Tech Toolkit.

Hashtag Electronics — Technology Explained. Problems Solved.

This guide is intended for educational and troubleshooting purposes. Commands and available options can vary by Windows/macOS version and system configuration. Back up important data before making significant system changes.