Terminal
Beginner
Windows Terminal & CMD Cheat Sheet
Essential Windows command prompt and terminal commands. File navigation, running tests, and process management on Windows.
Windows Terminal & CMD
Navigation
cd # Show current directory
dir # List files
dir /a # List all files including hidden
cd folder_name # Go into folder
cd .. # Go up one level
cd %USERPROFILE% # Go to home directory
Files & Folders
mkdir test-suite # Create folder
type nul > test.py # Create empty file
copy file.py backup.py # Copy file
move old.py new.py # Rename/move file
del file.py # Delete file
rmdir /s /q folder # Delete folder and contents
type file.py # Show file contents
Searching
findstr "ERROR" test.log # Find text in file
findstr /s "login" tests\*.py # Search in folder
dir /s /b *.py # Find files by extension
Running Tests
python -m pytest tests\
npx playwright test
mvn test
npm test
dotnet test
Processes
tasklist | findstr chrome # Find running processes
taskkill /PID 12345 # Kill by PID
taskkill /IM chrome.exe /F # Kill by name
Environment Variables
set BASE_URL=http://localhost:3000 # Set (current session)
echo %BASE_URL% # Read variable
setx BASE_URL "http://localhost:3000" # Set permanently
set # Show all variables
Useful Tips
- Windows Terminal (wt) supports tabs and split panes
- Use
clsto clear the screen - Use
&&to chain commands - Install Windows Terminal from Microsoft Store for the best experience
- WSL (Windows Subsystem for Linux) lets you run Bash on Windows