Dragons Hobbies Forum

General Category => General Discussions => Topic started by: Dragon on March 27, 2026, 23:24:22

Title: Command Line cheat sheet: LINUX → WINDOWS CMD → POWERSHELL
Post by: Dragon on March 27, 2026, 23:24:22
NAVIGATION
================================================================================
LinuxWindows CMDPowerShell ShortcutsPowerShell
--------------------------------------------------------------------------------
lsdirlsGet-ChildItem
pwdcdpwdGet-Location
cd /pathcd \pathcd pathSet-Location path
cd ..cd ..cd ..Set-Location ..
FILE OPERATIONS
================================================================================
LinuxWindows CMDPowerShell ShortcutsPowerShell
--------------------------------------------------------------------------------
touch filetype nul > fileni file.extNew-Item file.ext -ItemType File
cp src dstcopy src dstcp src dstCopy-Item src dst
mv src dstmove src dstmv src dstMove-Item src dst
rm filedel filerm fileRemove-Item file
rm -r dirrmdir /s dirrm dir -r -forceRemove-Item dir -Recurse -Force
DIRECTORY OPERATIONS
================================================================================
LinuxWindows CMDPowerShell ShortcutsPowerShell
--------------------------------------------------------------------------------
mkdir namemkdir namemkdir nameNew-Item name -ItemType Directory
rmdir namermdir namerm nameRemove-Item name
VIEWING & SEARCHING
================================================================================
LinuxWindows CMDPowerShell ShortcutsPowerShell
--------------------------------------------------------------------------------
cat filetype filegc fileGet-Content file
grep "txt" filefind "txt" filesls "txt" fileSelect-String "txt" file
grep -r "txt" dirfindstr /s /isls "txt" dir -rSelect-String -Pattern "txt" -Recurse
SYSTEM & PROCESSES
================================================================================
LinuxWindows CMDPowerShell ShortcutsPowerShell
--------------------------------------------------------------------------------
pstasklistgpsGet-Process
kill PIDtaskkill /PIDkill PIDStop-Process -Id PID
toptasklistgps | sort CPU -descGet-Process | Sort-Object CPU -Descending
df -hwmic logicaldiskgdrGet-PSDrive
free -hsysteminfo(none)Get-CimInstance Win32_OperatingSystem
NETWORKING
================================================================================
LinuxWindows CMDPowerShell ShortcutsPowerShell
--------------------------------------------------------------------------------
ifconfig / ip aipconfig(none)Get-NetIPAddress
ping hostping hostping hostTest-Connection host
traceroute hosttracert hosttnc host -tracerouteTest-NetConnection host -TraceRoute
curl urlcurl urlcurl urlInvoke-WebRequest url
wget urlcurl -O urliwr url -OutFile fileInvoke-WebRequest url -OutFile file
PERMISSIONS
================================================================================
LinuxWindows CMDPowerShell ShortcutsPowerShell
--------------------------------------------------------------------------------
chmodicacls(none)Set-Acl
chownicacls(none)Set-Acl
ENVIRONMENT VARIABLES
================================================================================
LinuxWindows CMDPowerShell ShortcutsPowerShell
--------------------------------------------------------------------------------
echo $VARecho %VAR%echo $env:VARWrite-Output $env:VAR
export VAR=valset VAR=val$env:VAR="val"$env:VAR = "value"
MISC
================================================================================
LinuxWindows CMDPowerShell ShortcutsPowerShell
--------------------------------------------------------------------------------
clearclsclearClear-Host
man cmdcmd /?help cmdGet-Help cmd