DevOps · 35 Days Day 04 — Linux for DevOps
1 / 21
Week 1 · Day 4

Linux for DevOps

Master the terminal — the most-used interface in DevOps. Every cloud server, Docker container, CI runner, and Kubernetes node runs Linux. Every command shown today includes the Windows equivalent (WSL2, PowerShell & Git Bash).

⊝ Duration 60 min
Theory 30 min
Lab 25 min
Quiz 5 min
Linux / Mac Windows (WSL2 + PowerShell) Git Bash
Session Overview

What we cover today

01
Why Linux Dominates DevOps
96% of cloud servers, 100% of Docker containers — Linux is unavoidable.
02
File System & Navigation
pwd, ls, cd, find — plus Windows equivalents (Get-Location, Get-ChildItem).
03
File Ops & Text Processing
cat, grep, tail, sed — analysing production logs fast. Select-String on Windows.
04
Processes, Services & Network
ps, top, systemctl, ss, curl — managing running applications on any OS.
05
File Permissions
chmod, chown, sudo — the permission model every DevOps engineer must know.
06
Shell Scripting Basics
Variables, conditionals, loops — bash and PowerShell side by side.
07
Lab — System Info Script
Write a script that reports hostname, OS, CPU, memory, disk, and DevOps tools installed. Works on Linux, Mac, WSL2 & Windows.
Part 1 of 6

Why Linux dominates DevOps

The Numbers
  • 96.3% of the world top 1M web servers run Linux
  • 90%+ of cloud VMs (AWS EC2, Azure, GCP) run Linux
  • 100% of Docker containers use the Linux kernel
  • 100% of Kubernetes nodes run Linux
  • All major CI runners (GitHub Actions, Jenkins agents) run Linux
Why Linux Won
  • Free & Open Source — no licensing at scale
  • Lightweight — runs on tiny VMs and containers
  • Stable — servers run for years without reboot
  • Scriptable — automate everything via shell
  • Ecosystem — every DevOps tool is Linux-first
Windows Users — Your 3 Options
WSL2 (Recommended) — Full Linux kernel inside Windows. Run Ubuntu 22.04 alongside Windows. Best experience for DevOps.

Git Bash — Comes with Git for Windows. Most Linux commands work. Zero extra install.

PowerShell — Native Windows automation. Every Linux command has a PS equivalent.

All three are shown side-by-side throughout today's session.
Install WSL2 Now (Windows)
Open PowerShell (Admin):
wsl --install
Restart → Ubuntu opens automatically. Set username + password.
Part 2 of 6 — Windows Setup

WSL2 — complete install guide

Step 1 — Enable WSL2 (PowerShell as Admin)
# Check if WSL already installed
wsl --status

# Single command: installs WSL2 + Ubuntu at once
wsl --install

# If above fails (older Windows 10), run manually:
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart

# Set WSL2 as default
wsl --set-default-version 2

# RESTART YOUR PC after the above commands
Step 2 — First Ubuntu Launch
# After restart: search "Ubuntu" in Start Menu, open it
# OR: open Windows Terminal and select Ubuntu from dropdown

# Ubuntu finishes setup then prompts:
   Enter new UNIX username: bastian   (lowercase, no spaces)
   New password:            ***        (won't show while typing)
   Retype new password:     ***

# Verify you are inside Linux:
uname -a
# Linux DESKTOP-XXXX 5.15.0-microsoft-standard-WSL2 ... GNU/Linux

cat /etc/os-release | grep PRETTY_NAME
# PRETTY_NAME="Ubuntu 22.04.3 LTS"
Step 3 — Update + Install DevOps Tools
# Inside Ubuntu terminal
sudo apt update && sudo apt upgrade -y

sudo apt install -y \
  curl wget git vim nano \
  htop tree unzip zip \
  net-tools iputils-ping \
  build-essential lsb-release

# Node.js via nvm (recommended over apt)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
source ~/.bashrc
nvm install --lts
node --version    # v20.x.x
npm --version     # 10.x.x

git --version     # git version 2.34.x
Step 4 — VS Code + Docker Integration
# Inside WSL2 terminal: open VS Code
code .
# VS Code opens, bottom-left shows ">< WSL: Ubuntu"
# All editing now happens inside Linux filesystem

# Docker Desktop auto-integrates with WSL2
docker --version
docker run hello-world
# Running from inside WSL2!

# Access Windows drive from WSL2:
ls /mnt/c/Users/YourName/Documents

# Access WSL2 files from Windows Explorer:
# Address bar: \wsl$\Ubuntu\home\yourname
Troubleshooting
WSL not found? Windows 10 must be version 2004+ (Build 19041+). Run: winver
Virtualisation error? Enable "Virtual Machine Platform" in Windows Features (Control Panel).
Docker not working? Docker Desktop Settings → Resources → WSL Integration → Enable Ubuntu.
Part 2 of 6

Navigation & File Operations

PurposeLinux / Mac / WSL2Windows PowerShellGit Bash
Current directorypwdGet-Location (pwd)pwd
List files (detailed)ls -laGet-ChildItem (ls)ls -la
Change directorycd /path/to/dirSet-Location C:\pathcd /path/to/dir
Go homecd ~  or  cdcd ~cd ~
Create directorymkdir -p a/b/cNew-Item -ItemType Dir a\b\cmkdir -p a/b/c
Create empty filetouch file.txtNew-Item file.txttouch file.txt
Copy filecp src destCopy-Item src destcp src dest
Move / Renamemv old newMove-Item old newmv old new
Delete filerm file.txtRemove-Item file.txtrm file.txt
Delete directoryrm -rf dir/Remove-Item -Recurse dir\rm -rf dir/
Find filesfind . -name "*.yml"Get-ChildItem -Recurse -Filter "*.yml"find . -name "*.yml"
View filecat file.txtGet-Content file.txtcat file.txt
Clear screenclear (Ctrl+L)Clear-Host (cls)clear
Power Tip — Tab Completion
Press Tab to auto-complete paths and file names. Works on Linux, Mac, WSL2, PowerShell, and Git Bash. Double-Tab lists all options. This one habit saves hours every week.
Part 3 of 6

grep, tail & Log Analysis

Linux / Mac / WSL2
# Basic search
grep "ERROR" /var/log/app.log

# Case-insensitive
grep -i "error" app.log

# Show line numbers
grep -n "WARN" app.log

# Recursive search in all .log files
grep -r "OutOfMemory" /var/log/

# Context: 3 lines before and after
grep -B3 -A3 "FATAL" app.log

# Count matches
grep -c "ERROR" app.log

# Exclude lines (inverse)
grep -v "DEBUG" app.log

# Live log follow + filter (ESSENTIAL!)
tail -f app.log | grep "ERROR"

# Last 20 lines
tail -20 app.log

# First 10 lines
head -10 app.log

# Count lines in a file
wc -l app.log

# Combine with pipes
cat app.log | grep "ERROR" | wc -l

# Replace text
sed 's/localhost/prod-db/g' config.yml

# Extract column (3rd field)
awk '{print $3}' access.log
Windows PowerShell
# Basic search
Select-String "ERROR" app.log

# Case-insensitive (default in PS)
Select-String "error" app.log

# Show line numbers (default in PS)
Select-String "WARN" app.log

# Recursive search
Get-ChildItem -Recurse *.log |
  Select-String "OutOfMemory"

# Context lines
Select-String "FATAL" app.log -Context 3,3

# Count matches
(Select-String "ERROR" app.log).Count

# Exclude lines
Get-Content app.log |
  Where-Object {$_ -notmatch "DEBUG"}

# Live follow + filter
Get-Content -Wait app.log |
  Where-Object { $_ -match "ERROR" }

# Last 20 lines
Get-Content app.log | Select -Last 20

# First 10 lines
Get-Content app.log | Select -First 10

# Count lines
(Get-Content app.log).Count

# Pipe + count
(Select-String "ERROR" app.log).Count

# Replace text
(Get-Content config.yml) -replace
  'localhost','prod-db' |
  Set-Content config.yml
Part 4 of 6

Processes, Services & Network

PurposeLinux / Mac / WSL2Windows PowerShell
List processesps auxGet-Process
Live CPU/memory monitortop  (or htop)Get-Process | Sort CPU -Desc
Kill process by PIDkill -9 <PID>Stop-Process -Id <PID>
Service statussystemctl status nginxGet-Service nginx
Start servicesystemctl start nginxStart-Service nginx
Open listening portsss -tlnpGet-NetTCPConnection -State Listen
HTTP requestcurl -I https://example.comInvoke-WebRequest https://example.com
DNS lookupdig example.comResolve-DnsName example.com
Ping hostping -c 4 google.comTest-Connection google.com
Disk usagedf -hGet-PSDrive
Memory usagefree -hGet-CimInstance Win32_OperatingSystem
Check if port opennc -zv host 443Test-NetConnection host -Port 443
WSL2 Tip
In WSL2, all Linux commands above work natively. Run Ubuntu terminal and get the full Linux experience inside Windows. Best of both worlds.
Part 5 of 6

File Permissions — chmod decoded

Permission Model
Every file has 3 sets × 3 types:

Who: Owner (u) | Group (g) | Others (o)
What: Read (r=4) | Write (w=2) | Execute (x=1)

-rwxr-xr--
type | owner(7) | group(5) | others(4)
7
rwx
Read+Write+Execute. Full access.
6
rw-
Read+Write. No execute.
5
r-x
Read+Execute. No write.
4
r--
Read only.
0
---
No access.
755
Standard
Scripts & dirs. Owner full, others read+exec.
Linux / Mac / WSL2
# View permissions
ls -la script.sh

# Make script executable (most common task)
chmod +x script.sh
chmod 755 script.sh     # same result

# Config files (owner read/write only)
chmod 600 ~/.ssh/id_rsa
chmod 644 /etc/nginx/nginx.conf

# Change ownership
chown user:group file.txt
chown -R ubuntu:ubuntu /opt/myapp/

# Run as superuser
sudo systemctl restart nginx
sudo chmod 755 /opt/app

whoami     # who am I?
id         # show full user + group IDs
Windows PowerShell
# View file permissions (ACL)
Get-Acl script.ps1 | Format-List

# Set file read-only
Set-ItemProperty file.txt -Name IsReadOnly $true

# Run as Administrator = Linux sudo
# Right-click PowerShell > "Run as Administrator"

# Check current user
whoami   # works in PS too!

# Set execution policy (run scripts)
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Part 5 of 6 — continued

Environment Variables & .bashrc

bash — Linux / Mac / WSL2
# View all env variables
env
printenv PATH

# Set temp variable (current session only)
export DB_PASSWORD="mypassword"
export APP_ENV="staging"

# Use variables
echo $DB_PASSWORD
echo "Running in: $APP_ENV"

# Make permanent (add to ~/.bashrc or ~/.zshrc)
echo 'export APP_ENV="production"' >> ~/.bashrc
source ~/.bashrc   # reload without restart

# Add to PATH permanently
echo 'export PATH="$PATH:/opt/myapp/bin"' >> ~/.bashrc

# Unset a variable
unset DB_PASSWORD

# Check if variable is set
if [ -z "$MY_VAR" ]; then
  echo "MY_VAR is not set!"
fi
Windows PowerShell
# View all env variables
Get-ChildItem Env:
$Env:PATH

# Set temp variable (current session)
$Env:DB_PASSWORD = "mypassword"
$Env:APP_ENV = "staging"

# Use variables
Write-Host $Env:DB_PASSWORD
Write-Host "Running in: $Env:APP_ENV"

# Permanent (User scope)
[System.Environment]::SetEnvironmentVariable(
  "APP_ENV", "production", "User")

# Add to PATH (User scope)
$p = [System.Environment]::GetEnvironmentVariable("PATH","User")
[System.Environment]::SetEnvironmentVariable(
  "PATH", "$p;C:\opt\myapp\bin", "User")

# Unset
Remove-Item Env:DB_PASSWORD

# Check if set
if (-not $Env:MY_VAR) {
  Write-Host "MY_VAR is not set!"
}
Security Critical Rule
NEVER hardcode secrets in scripts committed to Git. Use CI/CD secrets, Docker env files, or K8s Secrets to inject credentials at runtime. export DB_PASS="prod123" in a git-committed script = immediate security vulnerability.
Part 6 of 6

Shell Scripting Fundamentals

bash — Linux / Mac / WSL2
#!/bin/bash
# Shebang: tells OS to use bash interpreter

# Variables
APP_NAME="devops-app"
VERSION="1.0.0"
echo "Deploying $APP_NAME v$VERSION"

# Command substitution
DATE=$(date +%Y-%m-%d)
HOST=$(hostname)
echo "Host: $HOST | Date: $DATE"

# Conditionals
if [ "$APP_ENV" == "production" ]; then
  echo "Production deployment"
elif [ "$APP_ENV" == "staging" ]; then
  echo "Staging deployment"
else
  echo "Unknown environment"; exit 1
fi

# Loops over array
SERVICES=("nginx" "redis" "postgres")
for SERVICE in "${SERVICES[@]}"; do
  systemctl is-active --quiet $SERVICE \
    && echo "OK: $SERVICE" \
    || echo "DOWN: $SERVICE"
done

# Function with argument
check_port() {
  nc -z localhost $1 2>/dev/null \
    && echo "Port $1: OPEN" \
    || echo "Port $1: CLOSED"
}
check_port 80
check_port 8080
Windows PowerShell (.ps1)
# Variables
$AppName = "devops-app"
$Version = "1.0.0"
Write-Host "Deploying $AppName v$Version"

# Command substitution
$Date = Get-Date -Format "yyyy-MM-dd"
$HostName = $env:COMPUTERNAME
Write-Host "Host: $HostName | Date: $Date"

# Conditionals
$AppEnv = $env:APP_ENV
if ($AppEnv -eq "production") {
  Write-Host "Production deployment"
} elseif ($AppEnv -eq "staging") {
  Write-Host "Staging deployment"
} else {
  Write-Host "Unknown environment"
  exit 1
}

# Loops over array
$Services = @("nginx","redis","postgres")
foreach ($svc in $Services) {
  $s = Get-Service $svc -ErrorAction SilentlyContinue
  if ($s -and $s.Status -eq "Running") {
    Write-Host "OK: $svc" -ForegroundColor Green
  } else {
    Write-Host "DOWN: $svc" -ForegroundColor Red
  }
}

# Function
function Test-Port($Port) {
  $c = Test-NetConnection localhost -Port $Port -WA SilentlyContinue
  Write-Host "Port $Port`: $(if($c.TcpTestSucceeded){'OPEN'}else{'CLOSED'})"
}
Test-Port 80
Test-Port 8080
Hands-On Lab

System Info Script

Write bash + PowerShell scripts that report system info — runs on Linux, Mac, WSL2 & Windows

25 minutes
bash + PowerShell
Commit to GitHub
Lab — Steps

Build your sysinfo scripts

1
Open terminal
Linux/Mac: Terminal.  Windows: Search "Ubuntu" (WSL2) or Windows Terminal. Git Bash also works.
2
Create scripts directory
cd devops-35days-labs && mkdir -p scripts && cd scripts
3
Write the bash script
Create sysinfo.sh (full script on next slide). Make executable: chmod +x sysinfo.sh. Run: ./sysinfo.sh
4
Write the PowerShell script
Create sysinfo.ps1. Run: .\sysinfo.ps1  (If blocked: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser)
5
Practice grep on sample log
Create sample-app.log, then practice: grep "ERROR" sample-app.log | wc -l
6
Commit everything
git add . && git commit -m "feat(day4): sysinfo scripts bash+ps1" && git push
Lab — sysinfo.sh

The bash script

scripts/sysinfo.sh — Linux / Mac / WSL2
#!/bin/bash
echo "=================================================="
echo "   SYSTEM INFO REPORT"
echo "   Generated: $(date)"
echo "=================================================="

echo ""
echo "--- HOST ---"
echo "Hostname  : $(hostname)"
echo "OS        : $(uname -s) $(uname -r)"
echo "Arch      : $(uname -m)"
[ -f /etc/os-release ] && . /etc/os-release && echo "Distro    : $NAME $VERSION_ID"

echo ""
echo "--- USER ---"
echo "User      : $(whoami)"
echo "Home      : $HOME"
echo "Shell     : $SHELL"

echo ""
echo "--- RESOURCES ---"
CPU_CORES=$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo "N/A")
echo "CPU Cores : $CPU_CORES"
command -v free &>/dev/null && \
  free -h | awk '/^Mem:/{printf "Memory    : %s total, %s used\n",$2,$3}'
df -h / | awk 'NR==2{printf "Disk (/)  : %s used of %s (%s)\n",$3,$2,$5}'

echo ""
echo "--- NETWORK ---"
ip addr show 2>/dev/null | grep 'inet ' | grep -v '127.0.0.1' | \
  awk '{print "IP        : " $2}' | head -1
curl -s --max-time 3 -o /dev/null -w "Internet  : HTTP %{http_code}\n" http://google.com

echo ""
echo "--- DEVOPS TOOLS INSTALLED ---"
for TOOL in git docker kubectl helm terraform ansible node python3; do
  if command -v $TOOL &> /dev/null; then
    VER=$($TOOL --version 2>&1 | head -1)
    printf "  OK  %-12s %s\n" "$TOOL" "$VER"
  else
    printf "  --  %-12s not installed\n" "$TOOL"
  fi
done

echo ""
echo "=================================================="

# To run: chmod +x sysinfo.sh && ./sysinfo.sh
Lab — sysinfo.ps1

The PowerShell script

scripts/sysinfo.ps1 — Windows PowerShell
Write-Host "==================================================" -ForegroundColor Cyan
Write-Host "  SYSTEM INFO REPORT   $(Get-Date)" -ForegroundColor White
Write-Host "==================================================" -ForegroundColor Cyan

Write-Host "`n--- HOST ---" -ForegroundColor Yellow
Write-Host "Hostname : $env:COMPUTERNAME"
$os = Get-CimInstance Win32_OperatingSystem
Write-Host "OS       : $($os.Caption) $($os.Version)"
Write-Host "Arch     : $env:PROCESSOR_ARCHITECTURE"

Write-Host "`n--- USER ---" -ForegroundColor Yellow
Write-Host "User     : $env:USERNAME"
Write-Host "Home     : $env:USERPROFILE"

Write-Host "`n--- RESOURCES ---" -ForegroundColor Yellow
$cpu = Get-CimInstance Win32_Processor | Select -First 1
Write-Host "CPU      : $($cpu.Name) ($($cpu.NumberOfCores) cores)"
$totalGB = [math]::Round($os.TotalVisibleMemorySize/1MB,1)
$freeGB  = [math]::Round($os.FreePhysicalMemory/1MB,1)
$usedGB  = $totalGB - $freeGB
Write-Host "Memory   : ${usedGB}GB used / ${totalGB}GB total"
Get-PSDrive -PSProvider FileSystem | Where {$_.Used -gt 0} | ForEach {
  $u = [math]::Round($_.Used/1GB,1); $f = [math]::Round($_.Free/1GB,1)
  Write-Host "Disk $($_.Name):  ${u}GB used, ${f}GB free"
}

Write-Host "`n--- NETWORK ---" -ForegroundColor Yellow
$ip = (Get-NetIPAddress -AddressFamily IPv4 |
  Where {$_.IPAddress -ne "127.0.0.1"} | Select -First 1).IPAddress
Write-Host "IP       : $ip"
$ping = Test-Connection google.com -Count 1 -Quiet -ErrorAction SilentlyContinue
Write-Host "Internet : $(if($ping){'Connected'}else{'No connection'})"

Write-Host "`n--- DEVOPS TOOLS ---" -ForegroundColor Yellow
@("git","docker","kubectl","helm","terraform","node","python") | ForEach {
  if (Get-Command $_ -ErrorAction SilentlyContinue) {
    $v = (& $_ --version 2>&1 | Select -First 1)
    Write-Host "  OK  $_`: $v" -ForegroundColor Green
  } else {
    Write-Host "  --  $_`: not installed" -ForegroundColor DarkGray
  }
}
Write-Host "`n==================================================" -ForegroundColor Cyan
# Run: .\sysinfo.ps1
# If blocked: Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
Lab — Log Practice

Practise grep & log analysis

Linux / WSL2
# Create sample log
cat > /tmp/app.log << 'EOF'
2024-01-15 08:01 INFO  App started on port 3000
2024-01-15 08:05 WARN  Response time > 500ms
2024-01-15 08:07 ERROR Cache timeout on redis:6379
2024-01-15 08:15 ERROR NullPointerException in UserService
2024-01-15 08:22 WARN  Memory usage at 78%
2024-01-15 09:00 ERROR DB connection pool exhausted
EOF

# Try these:
grep "ERROR" /tmp/app.log
grep -c "ERROR" /tmp/app.log
grep -n "WARN\|ERROR" /tmp/app.log
grep -v "INFO" /tmp/app.log
tail -3 /tmp/app.log
grep "ERROR" /tmp/app.log | wc -l

# Real system logs
sudo tail -20 /var/log/syslog
journalctl -n 30 --no-pager
PowerShell
# Create sample log
@"
2024-01-15 08:01 INFO  App started on port 3000
2024-01-15 08:05 WARN  Response time > 500ms
2024-01-15 08:07 ERROR Cache timeout on redis:6379
2024-01-15 08:15 ERROR NullPointerException in UserService
2024-01-15 08:22 WARN  Memory usage at 78%
2024-01-15 09:00 ERROR DB connection pool exhausted
"@ | Set-Content "$env:TEMP\app.log"

# Try these:
Select-String "ERROR" "$env:TEMP\app.log"
(Select-String "ERROR" "$env:TEMP\app.log").Count
Select-String "WARN|ERROR" "$env:TEMP\app.log"
Get-Content "$env:TEMP\app.log" | Where {$_ -notmatch "INFO"}
Get-Content "$env:TEMP\app.log" | Select -Last 3

# Windows Event Log
Get-EventLog Application -EntryType Error -Newest 10
Knowledge Check

Quiz Time

3 questions · 5 minutes · Linux + Windows commands

Test your command knowledge →
QUESTION 1 OF 3
What does chmod 755 set, and what is the equivalent PowerShell command to view file permissions?
A
Owner rwx, Group r-x, Others r-x  |  Get-Acl
B
Owner rw-, Group rw-, Others rw-  |  icacls
C
Owner rwx, Group rwx, Others rwx  |  attrib
D
Owner r--, Group r--, Others r--  |  whoami /priv
QUESTION 2 OF 3
Which command monitors a live log in real time, and what is the PowerShell equivalent?
A
cat -f app.log  |  Get-Content app.log
B
tail -f app.log  |  Get-Content -Wait app.log
C
watch app.log  |  Monitor-File app.log
D
head -f app.log  |  Read-Host app.log
QUESTION 3 OF 3
What is the correct shebang line for a bash script, and which command makes it executable?
A
# /bin/bash  |  make +x script.sh
B
// bash  |  exec script.sh
C
#!/bin/bash  |  chmod +x script.sh
D
#!/usr/bash  |  chmod 777 script.sh
Day 4 — Complete

What you learned today

🗂
File System
Linux dirs + Windows equivalents. Navigate confidently on any OS.
🔍
grep + logs
grep, tail -f, pipes (Linux) and Select-String, Get-Content -Wait (PS).
🔐
Permissions
chmod 755/644/600, chown. Get-Acl on Windows. Security starts here.
📜
Scripting
Variables, conditionals, loops, functions in both bash and PowerShell.
Day 4 Action Items
  1. sysinfo.sh + sysinfo.ps1 committed to scripts/ folder
  2. Practice: grep "ERROR" app.log | wc -l
  3. Practice: chmod 755 sysinfo.sh && ./sysinfo.sh
  4. Windows: confirm WSL2 Ubuntu is working
Tomorrow — Day 5
Networking for DevOps

DNS, HTTP/HTTPS, TCP/IP, TLS certificates, ports, and curl debugging. Same dual-format: every command shown for Linux and Windows.

curl dig netstat openssl
Reference

Linux → Windows Cheatsheet

TaskLinux / Mac / WSL2PowerShellGit Bash
Working dirpwdGet-Locationpwd
List filesls -laGet-ChildItemls -la
View filecat fileGet-Content filecat file
Search textgrep "text" fileSelect-String "text" filegrep "text" file
Live logtail -f app.logGet-Content -Wait app.logtail -f app.log
Process listps auxGet-Processps aux
Kill processkill -9 PIDStop-Process -Id PIDkill -9 PID
Disk usagedf -hGet-PSDrivedf -h
HTTP requestcurl URLInvoke-WebRequest URLcurl URL
DNS lookupdig domainResolve-DnsName domainnslookup domain
Permissionschmod +x fileGet-Acl / Set-Aclchmod +x file
Current userwhoamiwhoamiwhoami
Env variableexport VAR=val$Env:VAR = "val"export VAR=val
Run as adminsudo commandRun as Administratorsudo (WSL)