Useful powershell commands (and cmd) Flashcards
must learn these!
How to convert from base64 powershell?
Show system information
systeminfo
List all running processes
tasklist
Kill a process by name
taskkill /IM [process_name] /F
Kill a process by PID
taskkill /PID [pid] /F
Clear the command prompt screen
cls
List files in a directory
dir
Change directory
cd [directory]
Create a new directory
mkdir [directory]
Remove a directory
rmdir /S /Q [directory]
Copy a file
copy [source] [destination]
Move or rename a file
move [source] [destination]
Delete a file (cmd)
del [file_name]
Show IP configuration
ipconfig /all
Release IP address
ipconfig /release
Renew IP address
ipconfig /renew
Flush DNS cache
ipconfig /flushdns
Display active network connections
netstat -an
Display listening ports
netstat -an | find “LISTEN”
Ping a host
ping [hostname_or_ip]
Trace route to a host
tracert [hostname_or_ip]
Check open ports on a remote host (cmd)
telnet [hostname_or_ip] [port]
Shutdown the computer
shutdown /s /t 0
Restart the computer
shutdown /r /t 0