Command Prompt/Powershell
Command Prompt/Powershell

Command Prompt/Powershell

Owner
Verification
Tags
Command Prompt/PowershellCurriculum

πŸ“‚ Navigation & File System

  • cd – Change Directory
  • Moves between folders.

    cd C:\Users\YourName\Documents
    cd ..        :: Move up one directory
    cd \         :: Jump to the root of the drive
    
    
  • dir – Directory Listing
  • Lists files and folders in the current directory.

    dir
    dir /a       :: Show hidden/system files
    dir /s       :: Show files in all subdirectories
    
    
  • cls – Clear Screen
  • Wipes the CMD window.

    cls
    
    

πŸ“„ File & Folder Management

  • mkdir or md – Make Directory
  • Creates a new folder.

    mkdir Projects
    
    
  • rmdir or rd – Remove Directory
  • Deletes a folder (empty by default).

    rmdir Projects
    rmdir /s Projects   :: Deletes folder + contents
    
    
  • copy – Copy File(s)
  • Copies files from one place to another.

    copy report.txt C:\Backup\
    
    
  • robocopy – Extended Copy (files + directories)
  • robocopy C:\Data D:\Backup /e /copyall
    
    
  • move – Move or Rename File
  • move oldname.txt newname.txt
    
    
  • del – Delete File
  • Removes a file permanently.

    del file.txt
    del *.tmp       :: Deletes all .tmp files
    
    

βš™οΈ System Information & Utilities

  • echo – Print text to screen
  • echo Hello, World!
    
    
  • ipconfig – Show network configuration
  • ipconfig
    ipconfig /all
    ipconfig /release && ipconfig /renew
    
    
  • ping – Test connectivity
  • ping google.com
    
    
  • tasklist – List running processes
  • tasklist
    
    
  • taskkill – Kill a process by name or PID
  • taskkill /im notepad.exe /f
    
    
  • systeminfo – Get system details
  • systeminfo
    
    
  • hostname – Displays computer’s hostname
  • hostname
    
    

πŸ” Searching & Filtering

  • find – Search inside files or output
  • find "error" logfile.txt
    
    
  • findstr – More advanced search (regex supported)
  • findstr /i "warning" logfile.txt
    
    
  • Pipes (|) – Send output of one command into another
  • ipconfig | find "IPv4"
    
    

πŸ“¦ Batch File Basics

  • Create a script file (.bat or .cmd) to automate commands:
  • @echo off
    echo Backing up Documents...
    xcopy C:\Users\YourName\Documents D:\Backup /e /h /i
    echo Done!
    pause
    
    

πŸ›‘οΈ Useful Admin Tools

  • chkdsk – Check disk for errors
  • chkdsk C:
    
    
  • sfc – System File Checker (repairs system files)
  • sfc /scannow
    
    
  • net user – Manage local users
  • net user
    net user NewUser MyPassword123 /add
    
    
  • shutdown – Shut down or restart computer
  • shutdown /s /f /t 0   :: Shutdown immediately
    shutdown /r /t 0      :: Restart immediately
    
    

βœ… Quick Reference Cheat Sheet

Task
Linux Command
Windows CMD Equivalent
Print current dir
pwd
cd (no args)
List files
ls
dir
Change dir
cd
cd
Create folder
mkdir
mkdir / md
Delete file
rm file
del file
Delete folder
rm -r folder
rmdir /s folder
Show network info
ifconfig/ip
ipconfig
Kill process
kill
taskkill