root@thehacksparrow:~/writeups$ SYSTEM ONLINE
root@sparrow:~/writeups$ cat guia-comandos-powershell.md
// tools

Basic PowerShell & CMD Commands

22 Jul 2026 · 3 min read

A reference for basic CMD and PowerShell commands — the Windows equivalent of the Linux commands cheat sheet. Includes the equivalent of each typical action (navigation, processes, network) in both shells, since on real machines you can run into either one.

TypeCommand reference
ShellsCMD (command prompt) and PowerShell

CMD — basic commands

TaskCMD commandDescription
List folder contentsdirLists files and folders
Change directorycd folder_nameEnters a folder
Go up one levelcd ..Returns to the parent folder
Clear screenclsClears the console
Create/remove foldermkdir name / rmdir nameCreates or removes an empty folder
Delete a filedel file.txtDeletes a file
Copy / move filescopy source dest / move source destCopies or moves/renames
Show current pathcdShows the current directory
View network configipconfigIP addresses and interfaces
View active processestasklistList of running processes
Kill a processtaskkill /IM name.exe /FCloses a process by name
View a file's contenttype file.txtShows the file's text
System informationsysteminfoWindows version, hotfixes, etc.
Active connections/portsnetstatNetwork status
View current privilegeswhoami /privCurrent user's permissions

Viewing saved WiFi passwords (CMD, as admin)

for /f "skip=9 tokens=1,2 delims=:" %i in ('netsh wlan show profiles') do @echo SSID: %j & netsh wlan show profile name=%j key=clear | findstr /C:"Key Content"

PowerShell — basic commands

PowerShell uses cmdlets with the Verb-Noun structure (e.g. Get-Process, Set-Location, New-Item).

TaskPowerShell commandDescription
List folder contentsGet-ChildItem / lsLists files and folders
Change directorySet-Location name / cd nameEnters a folder
Clear screenClear-Host / clsClears the console
Create a folderNew-Item -ItemType Directory -Name nameCreates a folder
Delete folder/fileRemove-Item name -RecurseDeletes a folder (with content) or file
Copy / move filesCopy-Item source dest / Move-Item source destCopies or moves/renames
Show current pathGet-LocationCurrent directory
View IP addressGet-NetIPAddressNetwork configuration
View active processesGet-ProcessList of processes
Kill a processStop-Process -Name nameCloses a process
Test connectivityTest-Connection google.comNetwork test
View servicesGet-ServiceSystem services
Help for a cmdletGet-Help <cmdlet>Built-in documentation

Useful shortcuts

ShortcutAction
Ctrl + LClears the screen
Ctrl + CStops or cancels the running command