0% found this document useful (0 votes)
2 views

Useful Commands Per OS

The document provides a comprehensive comparison of command-line tasks across Windows, Linux, and macOS for system information, user management, process management, network connectivity, and more. It includes specific commands for each operating system to perform various administrative functions such as checking system uptime, managing users, and monitoring system resources. Additionally, it covers package management, security checks, and automation tasks, making it a useful reference for system administrators.

Uploaded by

nexusnike4
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Useful Commands Per OS

The document provides a comprehensive comparison of command-line tasks across Windows, Linux, and macOS for system information, user management, process management, network connectivity, and more. It includes specific commands for each operating system to perform various administrative functions such as checking system uptime, managing users, and monitoring system resources. Additionally, it covers package management, security checks, and automation tasks, making it a useful reference for system administrators.

Uploaded by

nexusnike4
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Images: Canva AI technology

By Jhon G.

Task Windows Command Linux macOS


CMD PowerShell Command Command
1. System Information
Operating winver `$osVersion = Get- lsb_release sw_vers -
System WmiObject -Class -a or uname productVersio
Version Win32_OperatingSystem -a n

Hardware systeminfo `$hardwareSpecs = Get- lshw or system_profile


Specificat WmiObject -Class lscpu r
ions Win32_ComputerSystem SPHardwareDa
taType

Kernel N/A $kernelVersion = uname -r uname -r


Version [System.Environment]::OSVe
rsion.Version

System systeminfo or `$uptime = Get-WmiObject - uptime or uptime


Uptime net statistics Class cat
workstation Win32_OperatingSystem /proc/upti
me

Network ipconfig or `$networkConfig = Get- ip addr or ifconfig or


Configura ifconfig NetAdapter ifconfig ipconfig
tion getifaddr en0

2. File System and Directory Structure

Navigatin dir, cd Set-Location -Path <path> ls, cd ls, cd


g
Directorie
s
File and icacls, takeown Get-Acl -Path <path> ls -l, chmod, ls -l, chmod,
Folder chown chown
Permissio
ns

Checking dir, fsutil, wmic `Get-WmiObject -Class df, du df, du


Disk Win32_LogicalDisk
Usage

Identifyin N/A Get-ChildItem -Path <path> - N/A N/A


g System Directory
Directorie
s and
Purposes

3. User and Group Management


Listing net user, wmic Get-LocalUser cat dscl . -list
Users /etc/passw /Users
d

Managing net user, wmic New-LocalUser -Name useradd, sudo dscl . -


User <username> -Password usermod, create
Accounts (ConvertTo-SecureString - userdel /Users/[userna
AsPlainText "<password>" - me]
Force)

User and icacls, takeown Get-Acl -Path <path> chmod, chmod,


Group chown, chown, chgrp
Permissio chgrp
ns

4. Process Management

Viewing tasklist Get-Process ps, top ps, top


Running
Processes
Managing taskkill Stop-Process -Name kill, pkill, kill, pkill, killall
Processes <processname> killall

Investigat tasklist, wmic `Get-Process -Name ps -ef, lsof, ps -ef, lsof,


ing <processname> fuser fuser
Process
Informati
on

5. Network and Connectivity

Checking ping, tracert Test-NetConnection - ping, ping,


Network ComputerName traceroute traceroute
Connectiv <hostname>
ity
Identifyin netstat, Get- `Get-NetTCPConnection netstat, ss netstat, lsof -i,
g Active NetTCPConnecti lsof -
Network on i:port_number
Connecti
ons

Investigat ipconfig or Get-NetAdapter - ip addr or ifconfig or


ing ifconfig IncludeHidden ifconfig ipconfig
Network getifaddr en0
Informati
on

6. System Services

Viewing services.msc, sc Get-Service systemctl launchctl list,


Running query list-units, sudo launchctl
Services service -- list
status-all
Starting, services.msc, sc Start-Service -Name systemctl sudo launchctl
Stopping, start/stop/restar <servicename><br>Stop- start/stop/r start/stop/rest
Restartin t [service] Service -Name estart art [service]
g Services <servicename><br>Restart- [service],
Service -Name service
<servicename> [service]
start/stop/r
estart

Configuri services.msc, sc Set-Service -Name systemctl sudo launchctl


ng config [service] <servicename> -StartupType enable/disa enable/disable
Service start= <Automatic/Manual/Disable ble [service]
Startup [auto/manual/di d> [service],
Behavior sabled] update-rc.d
[service]
enable/disa
ble

7. System Logs and Monitoring

Accessing Event Viewer, Get-EventLog -LogName syslog, /var/log/syste


System wevtutil <logname> journalctl m.log, Console
Logs app

Monitori Task Manager, Get-Counter -Counter top, htop, Activity


ng Performance "\Processor(_Total)\% htop Monitor, top,
System Monitor Processor Time" htop
Resource
Usage

Analyzing Event Viewer, Select-String -Pattern grep, tail, grep, tail, less
Log Files wevtutil <pattern> -Path <path> less

8. Package Management

Managing Chocolatey, Get-Package apt, yum, Homebrew,


Software Scoop dnf MacPorts
Packages
Listing choco list -- `Get-Package dpkg -l, apt brew list, port
Installed localonly, scoop list -- installed
Packages list installed,
and rpm -qa
Versions

Configuri Chocolatey, Register-PackageSource - apt, yum, Homebrew,


ng Scoop ProviderName dnf MacPorts
Package <providername> -Location
Repositor <location> -Name <name>
ies

9. Security and Encryption


Checking certutil -hashfile Get-FileHash -Path <path> sha256sum shasum -a 256
File [file] [file], [file], md5
Integrity [hash_algorithm md5sum [file]
] [file]

Working BitLocker, EFS Import-Certificate -FilePath GPG, FileVault,


with <certificatefile> OpenSSL encryption
Encryptio utilities
n Tools
and Keys

Scanning Windows `Get-MpThreatCatalog ClamAV, XProtect,


for Defender, rkhunter, ClamAV,
Malware Security chkrootkit EtreCheck,
and Essentials KnockKnock
Security
Vulnerabi
lities

10. System Maintenance and Automation

Schedulin Task Scheduler Register-ScheduledJob - Cron, launchd, cron


g and Name <jobname> - crontab
Managing ScriptBlock {<scriptblock>}
Tasks and
Cron Jobs
Automati Batch files (.bat, Create a .ps1 script file and Bash scripts Bash scripts,
ng .cmd), execute it using Automator,
Repetitiv PowerShell PowerShell.exe -File AppleScript
e Tasks scripts <scriptfile>
with Shell
Scripts

Configuri Windows New-WBBackupTarget - rsync, tar, Time Machine,


ng Backup, third- BackupTarget <path> cron rsync, cron
System party backup
Backups tools

Folow me: Jhon G.

You might also like