Complete Command Line Reference: CMD, PowerShell & Bash Commands [2026]
• 10 min read
command line cmd commands powershell commands bash commands windows commands command reference terminal shell scripting system administration
The command line is the most powerful tool for system administrators, developers, and IT professionals. This comprehensive reference covers 500+ commands across CMD, PowerShell, and Bash, providing syntax, examples, and practical use cases for everyday tasks.
Whether you’re managing Windows servers, automating tasks with scripts, or working across platforms, this guide serves as your go-to reference for command line operations.
Table of Contents
- Introduction to Command Lines
- CMD vs PowerShell vs Bash
- Essential CMD Commands
- Essential PowerShell Cmdlets
- Bash Commands for Windows
- File Operations
- Directory Management
- Network Commands
- System Information
- User & Permission Management
- Active Directory Commands
- Process Management
- Quick Reference Tables
- Command Equivalents
- Frequently Asked Questions
Introduction to Command Lines
What is a Command Line Interface (CLI)?
A command line interface is a text-based interface for interacting with computer operating systems and software. Unlike graphical user interfaces (GUIs), CLIs allow users to execute commands by typing text commands.
Benefits of Command Line:
- Speed: Faster than clicking through multiple menus
- Automation: Scripts automate repetitive tasks
- Remote Management: Manage systems over SSH or PowerShell Remoting
- Resource Efficiency: Lower resource overhead than GUIs
- Precision: Exact control over system operations
- Batch Operations: Process hundreds of files with single command
Three Primary Command Line Environments
- CMD (Command Prompt): Legacy Windows command line
- PowerShell: Modern Windows automation framework
- Bash: Unix/Linux shell (available on Windows via WSL)
CMD vs PowerShell vs Bash
Feature Comparison
| Feature | CMD | PowerShell | Bash |
|---|---|---|---|
| Platform | Windows only | Windows, Linux, macOS | Unix/Linux/macOS, WSL |
| Release | 1981 | 2006 | 1989 |
| Scripting | Batch files (.bat) | Scripts (.ps1) | Shell scripts (.sh) |
| Object Model | Text-based | Object-based | Text-based |
| Aliases | Limited | Extensive | Extensive |
| Remote Management | Limited | Built-in (PS Remoting) | SSH |
| Package Manager | None | PowerShellGet | apt, yum, brew |
| Modern Features | ❌ Limited | ✅ Extensive | ✅ Extensive |
When to Use Each
Use CMD when:
- Running legacy batch scripts
- Quick file/directory operations
- Working with older Windows systems
- Simple tasks (navigating, copying files)
Use PowerShell when:
- Automating Windows administration
- Managing Active Directory
- Working with Azure, Microsoft 365
- Complex scripting with objects
- Remote system management
Use Bash when:
- Cross-platform scripting
- Linux/Unix server administration
- Development workflows (git, make, etc.)
- Container and DevOps operations
Essential CMD Commands
Navigation Commands
cd - Change Directory
Syntax:
cd [path]
```powershell
**Examples:**
```cmd
cd C:\Windows # Change to Windows directory
cd .. # Go to parent directory
cd \ # Go to root directory
cd "C:\Program Files" # Quotes for spaces
```powershell
**Related**: [How to Change Directory in CMD](/cmd-change-directory)
#### dir - List Directory Contents
**Syntax:**
```cmd
dir [path] [options]
```powershell
**Common Options:**
- `/A`: Show hidden files
- `/S`: Include subdirectories
- `/B`: Bare format (names only)
- `/O:N`: Order by name
- `/O:D`: Order by date
**Examples:**
```cmd
dir # List current directory
dir /A # Include hidden files
dir /S *.txt # Find all .txt files recursively
dir /B > filelist.txt # Save file list to text file
```powershell
**Related**: [CMD List Files in Directory](/cmd-list-files-in-directory)
#### tree - Display Directory Structure
**Syntax:**
```cmd
tree [path] [options]
```powershell
**Examples:**
```cmd
tree # Show tree of current directory
tree /F # Include files
tree C:\Projets /A # ASCII characters (for redirection)
```powershell
### File Operations
#### copy - Copy Files
**Syntax:**
```cmd
copy source destination [options]
```powershell
**Examples:**
```cmd
copy file.txt D:\Backup # Copy single file
copy *.txt D:\Documents # Copy all .txt files
copy file1.txt+file2.txt merged.txt # Concatenate files
```powershell
**Related**: [CMD Copy a File](/cmd-copy-a-file)
#### xcopy - Advanced Copy
**Syntax:**
```cmd
xcopy source destination [options]
```powershell
**Common Options:**
- `/E`: Copy subdirectories including empty ones
- `/Y`: Suppress overwrite confirmation
- `/D`: Copy only files newer than destination
**Examples:**
```cmd
xcopy C:\Source D:\Backup /E /Y # Copy entire directory tree
xcopy C:\Data D:\Backup /D /E /Y # Incremental backup
```powershell
#### move - Move/Rename Files
**Syntax:**
```cmd
move source destination
```powershell
**Examples:**
```cmd
move file.txt D:\Documents # Move file
move oldname.txt newname.txt # Rename file
move *.log D:\Logs # Move all .log files
```powershell
#### del - Delete Files
**Syntax:**
```cmd
del [path] [options]
```powershell
**Common Options:**
- `/P`: Prompt for confirmation
- `/F`: Force delete read-only files
- `/S`: Delete from subdirectories
- `/Q`: Quiet mode (no confirmation)
**Examples:**
```cmd
del file.txt # Delete single file
del *.tmp # Delete all .tmp files
del /S /Q *.bak # Delete all .bak files recursively
```powershell
**Related**: [CMD Delete All Files in a Directory](/cmd-delete-all-files-in-a-directory)
#### type - Display File Contents
**Syntax:**
```cmd
type filename
```powershell
**Examples:**
```cmd
type file.txt # Display file contents
type file.txt | more # Display with pagination
```powershell
### Directory Operations
#### mkdir - Create Directory
**Syntax:**
```cmd
mkdir directory_name
```powershell
**Examples:**
```cmd
mkdir NewFolder # Create directory
mkdir "New Folder" # Quotes for spaces
mkdir C:\Temp\Subfolder # Create with path
```powershell
**Related**: [CMD Create New Directory](/cmd-create-new-directory)
#### rmdir - Remove Directory
**Syntax:**
```cmd
rmdir [path] [options]
```powershell
**Common Options:**
- `/S`: Remove directory and all contents
- `/Q`: Quiet mode (no confirmation)
**Examples:**
```cmd
rmdir EmptyFolder # Remove empty directory
rmdir /S /Q OldFolder # Remove directory and contents
```powershell
**Related**: [CMD Delete Directory](/cmd-delete-directory)
### System Commands
#### systeminfo - Display System Information
**Syntax:**
```cmd
systeminfo [/S computer] [/U user]
```powershell
**Examples:**
```cmd
systeminfo # Display local system info
systeminfo | findstr "System Type" # Filter specific information
```powershell
#### tasklist - List Running Processes
**Syntax:**
```cmd
tasklist [options]
```powershell
**Examples:**
```cmd
tasklist # List all processes
tasklist /FI "IMAGENAME eq notepad.exe" # Filter processes
tasklist /SVC # Show services in each process
```powershell
#### taskkill - Terminate Processes
**Syntax:**
```cmd
taskkill /IM imagename | /PID processid [options]
```powershell
**Common Options:**
- `/F`: Force termination
- `/T`: Terminate process tree
**Examples:**
```cmd
taskkill /IM notepad.exe # Kill notepad
taskkill /PID 1234 /F # Force kill by process ID
taskkill /IM chrome.exe /F /T # Kill Chrome and child processes
```powershell
---
## Essential PowerShell Cmdlets
### File System Cmdlets
#### Get-ChildItem - List Files and Directories
**Syntax:**
```powershell
Get-ChildItem [[-Path] <String[]>] [parameters]
```powershell
**Aliases:** `gci`, `ls`, `dir`
**Examples:**
```powershell
Get-ChildItem # List current directory
Get-ChildItem -Recurse # List recursively
Get-ChildItem -Filter *.txt # Filter by extension
Get-ChildItem -Hidden # Show hidden files
Get-ChildItem | Where-Object {$_.Length -gt 1MB} # Files > 1MB
```powershell
**Related**: Our comprehensive guides:
- [PowerShell List Files in Directory](/powershell-list-files-in-directory)
- [PowerShell Get-ChildItem Filters](/powershell-get-childitem-with-filter)
- Get-ChildItem Files Only
- Get-ChildItem Hidden Files
- Get-ChildItem Large Files
#### Copy-Item - Copy Files and Directories
**Syntax:**
```powershell
Copy-Item [-Path] <String[]> [-Destination] <String> [parameters]
```powershell
**Examples:**
```powershell
Copy-Item file.txt D:\Backup # Copy file
Copy-Item C:\Source D:\Dest -Recurse # Copy directory tree
Copy-Item *.txt D:\Documents # Copy multiple files
```powershell
#### Remove-Item - Delete Files and Directories
**Syntax:**
```powershell
Remove-Item [-Path] <String[]> [parameters]
```powershell
**Examples:**
```powershell
Remove-Item file.txt # Delete file
Remove-Item C:\Temp\* -Recurse # Delete all contents
Remove-Item *.log -Force # Force delete
```powershell
**Related**:
- [PowerShell Delete All Files in Folder](/powershell-delete-all-files-in-folder)
- PowerShell Delete Files Older Than X Days
- PowerShell Delete Empty Folders
#### Get-Content - Read File Contents
**Syntax:**
```powershell
Get-Content [-Path] <String[]> [parameters]
```powershell
**Aliases:** `gc`, `cat`, `type`
**Examples:**
```powershell
Get-Content file.txt # Read entire file
Get-Content file.txt -TotalCount 10 # First 10 lines
Get-Content file.txt -Tail 5 # Last 5 lines
Get-Content file.txt | Where-Object {$_ -match "error"} # Filter lines
```powershell
**Related**:
- [PowerShell Get First Line of File](/powershell-get-first-line-of-file)
- [PowerShell Get Content Skip First Line](/powershell-get-content-skip-first-line)
### Process Management Cmdlets
#### Get-Process - Retrieve Process Information
**Syntax:**
```powershell
Get-Process [[-Name] <String[]>] [parameters]
```powershell
**Aliases:** `gps`, `ps`
**Examples:**
```powershell
Get-Process # List all processes
Get-Process -Name notepad # Specific process
Get-Process | Sort-Object CPU -Descending | Select-Object -First 10 # Top CPU users
```powershell
**Related**: [PowerShell Get-Process Guide](/powershell-get-process)
#### Stop-Process - Terminate Processes
**Syntax:**
```powershell
Stop-Process [-Id] <Int32[]> | [-Name] <String[]> [parameters]
```powershell
**Examples:**
```powershell
Stop-Process -Name notepad # Stop by name
Stop-Process -Id 1234 # Stop by process ID
Get-Process chrome | Stop-Process # Pipeline usage
```powershell
### Service Management
#### Get-Service - Retrieve Service Information
**Syntax:**
```powershell
Get-Service [[-Name] <String[]>] [parameters]
```powershell
**Aliases:** `gsv`
**Examples:**
```powershell
Get-Service # List all services
Get-Service -Name wuauserv # Specific service (Windows Update)
Get-Service | Where-Object {$_.Status -eq 'Running'} # Running services
```powershell
#### Start-Service / Stop-Service
**Examples:**
```powershell
Start-Service -Name wuauserv # Start service
Stop-Service -Name wuauserv # Stop service
Restart-Service -Name wuauserv # Restart service
Set-Service -Name wuauserv -StartupType Automatic # Set startup type
```powershell
---
## Bash Commands for Windows (WSL)
### File Operations
#### ls - List Directory Contents
**Syntax:**
```bash
ls [options] [path]
```powershell
**Common Options:**
- `-l`: Long format (permissions, owner, size, date)
- `-a`: Show hidden files (starting with .)
- `-h`: Human-readable sizes
- `-R`: Recursive
- `-t`: Sort by modification time
**Examples:**
```bash
ls # List current directory
ls -lah # Long format, all files, human-readable
ls -ltr # Long format, sorted by time (reverse)
find . -name "*.txt" # Find all .txt files
```powershell
#### cp - Copy Files
**Syntax:**
```bash
cp [options] source destination
```powershell
**Common Options:**
- `-r`: Copy directories recursively
- `-i`: Interactive (prompt before overwrite)
- `-v`: Verbose
- `-p`: Preserve attributes
**Examples:**
```bash
cp file.txt /backup/ # Copy file
cp -r directory/ /backup/ # Copy directory
cp -v *.txt /documents/ # Copy with verbose output
```powershell
#### mv - Move/Rename Files
**Syntax:**
```bash
mv [options] source destination
```powershell
**Examples:**
```bash
mv file.txt /destination/ # Move file
mv oldname.txt newname.txt # Rename file
mv *.log /logs/ # Move multiple files
```powershell
#### rm - Remove Files
**Syntax:**
```bash
rm [options] file
```powershell
**Common Options:**
- `-r`: Remove directories recursively
- `-f`: Force (no prompts)
- `-i`: Interactive (prompt for each file)
**Examples:**
```bash
rm file.txt # Delete file
rm -rf directory/ # Delete directory and contents (careful!)
rm *.tmp # Delete all .tmp files
```powershell
### Text Processing
#### grep - Search Text
**Syntax:**
```bash
grep [options] pattern [files]
```powershell
**Common Options:**
- `-i`: Case-insensitive
- `-r`: Recursive search
- `-n`: Show line numbers
- `-v`: Invert match (show non-matching lines)
**Examples:**
```bash
grep "error" logfile.txt # Search for "error"
grep -ri "password" /var/log/ # Recursive, case-insensitive
grep -n "TODO" *.py # Show line numbers
```powershell
#### sed - Stream Editor
**Syntax:**
```bash
sed [options] 'command' file
```powershell
**Examples:**
```bash
sed 's/old/new/' file.txt # Replace first occurrence per line
sed 's/old/new/g' file.txt # Replace all occurrences
sed -i 's/old/new/g' file.txt # Edit file in-place
```powershell
#### awk - Text Processing
**Syntax:**
```bash
awk 'pattern {action}' file
```powershell
**Examples:**
```bash
awk '{print $1}' file.txt # Print first column
awk -F':' '{print $1}' /etc/passwd # Use : as delimiter
awk '$3 > 100' data.txt # Filter rows where column 3 > 100
```powershell
---
## File Operations
### Quick Reference Table
| Task | CMD | PowerShell | Bash |
|------|-----|-----------|------|
| **List files** | `dir` | `Get-ChildItem` | `ls -la` |
| **Copy file** | `copy file.txt dest\` | `Copy-Item file.txt dest\` | `cp file.txt dest/` |
| **Move file** | `move file.txt dest\` | `Move-Item file.txt dest\` | `mv file.txt dest/` |
| **Delete file** | `del file.txt` | `Remove-Item file.txt` | `rm file.txt` |
| **View file** | `type file.txt` | `Get-Content file.txt` | `cat file.txt` |
| **Find files** | `dir /S /B *.txt` | `Get-ChildItem -Recurse -Filter *.txt` | `find . -name "*.txt"` |
| **File size** | `dir file.txt` | `(Get-Item file.txt).Length` | `ls -lh file.txt` |
---
## Directory Management
### Quick Reference Table
| Task | CMD | PowerShell | Bash |
|------|-----|-----------|------|
| **Current directory** | `cd` | `Get-Location` | `pwd` |
| **Change directory** | `cd path` | `Set-Location path` | `cd path` |
| **Create directory** | `mkdir folder` | `New-Item -ItemType Directory` | `mkdir folder` |
| **Remove directory** | `rmdir /S folder` | `Remove-Item -Recurse` | `rm -rf folder` |
| **List directories** | `dir /AD` | `Get-ChildItem -Directory` | `ls -d */` |
---
## Network Commands
### CMD Network Commands
#### ping - Test Network Connectivity
**Syntax:**
```cmd
ping [-t] [-n count] target
```powershell
**Examples:**
```cmd
ping google.com # Ping 4 times (default)
ping -t google.com # Ping continuously
ping -n 10 192.168.1.1 # Ping 10 times
```powershell
#### ipconfig - IP Configuration
**Syntax:**
```cmd
ipconfig [/all] [/release] [/renew] [/flushdns]
```powershell
**Examples:**
```cmd
ipconfig # Basic IP info
ipconfig /all # Detailed info
ipconfig /flushdns # Clear DNS cache
ipconfig /release # Release DHCP lease
ipconfig /renew # Renew DHCP lease
```powershell
#### netstat - Network Statistics
**Syntax:**
```cmd
netstat [options]
```powershell
**Common Options:**
- `-a`: Show all connections
- `-n`: Show addresses numerically
- `-o`: Show process ID
- `-b`: Show executable name
**Examples:**
```cmd
netstat -an # All connections, numeric
netstat -ano # Include process IDs
netstat -ano | findstr "LISTENING" # Show listening ports
```powershell
#### nslookup - DNS Lookup
**Syntax:**
```cmd
nslookup [host] [dns-server]
```powershell
**Examples:**
```cmd
nslookup google.com # DNS lookup
nslookup google.com 8.8.8.8 # Use specific DNS server
```powershell
### PowerShell Network Cmdlets
#### Test-Connection - Ping Alternative
**Syntax:**
```powershell
Test-Connection [-ComputerName] <String[]> [parameters]
```powershell
**Examples:**
```powershell
Test-Connection google.com # Ping (4 times)
Test-Connection google.com -Count 10 # Ping 10 times
Test-Connection google.com -Quiet # Return boolean only
```powershell
#### Get-NetIPAddress - IP Configuration
**Syntax:**
```powershell
Get-NetIPAddress [parameters]
```powershell
**Examples:**
```powershell
Get-NetIPAddress # All IP addresses
Get-NetIPAddress -AddressFamily IPv4 # IPv4 only
```powershell
#### Resolve-DnsName - DNS Resolution
**Syntax:**
```powershell
Resolve-DnsName [-Name] <String> [parameters]
```powershell
**Examples:**
```powershell
Resolve-DnsName google.com # DNS lookup
Resolve-DnsName google.com -Type MX # MX records
```powershell
---
## Active Directory Commands
### CMD AD Commands
#### net user - Manage Users
**Syntax:**
```cmd
net user [username [password | *] [options]] [/DOMAIN]
```powershell
**Examples:**
```cmd
net user /DOMAIN # List all domain users
net user jdoe /DOMAIN # Get user info
net user jdoe NewPass123! /DOMAIN # Change password
net user jdoe /ACTIVE:NO /DOMAIN # Disable account
```powershell
#### net group - Manage Groups
**Syntax:**
```cmd
net group [groupname [/COMMENT:"text"]] [/DOMAIN]
```powershell
**Examples:**
```cmd
net group /DOMAIN # List all domain groups
net group "Domain Admins" /DOMAIN # List group members
net group "IT-Staff" jdoe /ADD /DOMAIN # Add user to group
```powershell
#### dsquery - Query Active Directory
**Syntax:**
```cmd
dsquery objecttype [parameters]
```powershell
**Examples:**
```cmd
dsquery user -name "John*" # Find users named John*
dsquery computer -inactive 4 # Computers inactive 4+ weeks
dsquery * -filter "(objectClass=user)" -limit 0 # All users
```powershell
**Related**: [Dsquery Guide](/dsquery)
#### dsacls - Display/Modify Permissions
**Syntax:**
```cmd
dsacls objectDN [parameters]
```powershell
**Examples:**
```cmd
dsacls "CN=John Doe,OU=Users,DC=contoso,DC=com" # Show ACL
dsacls "OU=Sales,DC=contoso,DC=com" /G "contoso\HelpDesk:RPWP;pwdLastSet" # Grant password reset
```powershell
**Related**: [Dsacls Complete Guide](/dsacls)
### PowerShell Active Directory Module
#### Get-ADUser - Retrieve Users
**Syntax:**
```powershell
Get-ADUser [parameters]
```powershell
**Examples:**
```powershell
Get-ADUser -Identity jdoe # Get specific user
Get-ADUser -Filter * -SearchBase "OU=Sales,DC=contoso,DC=com" # All users in OU
Get-ADUser -Filter {Enabled -eq $false} # Disabled users
```powershell
For comprehensive AD coverage, see our [Complete Active Directory Guide](/complete-active-directory-guide).
---
## Quick Reference Tables
### Top 50 CMD Commands
| Command | Description | Example |
|---------|-------------|---------|
| `cd` | Change directory | `cd C:\Windows` |
| `dir` | List directory | `dir /A` |
| `copy` | Copy files | `copy file.txt D:\` |
| `del` | Delete files | `del *.tmp` |
| `mkdir` | Create directory | `mkdir NewFolder` |
| `rmdir` | Remove directory | `rmdir /S folder` |
| `type` | Display file | `type file.txt` |
| `find` | Find text in file | `find "error" logfile.txt` |
| `ping` | Test connectivity | `ping google.com` |
| `ipconfig` | IP configuration | `ipconfig /all` |
| `netstat` | Network statistics | `netstat -an` |
| `tasklist` | List processes | `tasklist` |
| `taskkill` | Kill process | `taskkill /IM notepad.exe` |
| `systeminfo` | System information | `systeminfo` |
| `chkdsk` | Check disk | `chkdsk C: /F` |
| `sfc` | System file checker | `sfc /scannow` |
| `shutdown` | Shutdown computer | `shutdown /s /t 0` |
| `gpupdate` | Update group policy | `gpupdate /force` |
| `hostname` | Display computer name | `hostname` |
| `whoami` | Display current user | `whoami` |
[See our CMD tutorials for detailed guides on each command]
### Top 100 PowerShell Cmdlets
| Cmdlet | Description | Example |
|--------|-------------|---------|
| `Get-ChildItem` | List files/directories | `Get-ChildItem -Recurse` |
| `Get-Process` | List processes | `Get-Process` |
| `Get-Service` | List services | `Get-Service` |
| `Get-Content` | Read file | `Get-Content file.txt` |
| `Set-Content` | Write file | `Set-Content file.txt "text"` |
| `Copy-Item` | Copy item | `Copy-Item -Recurse` |
| `Move-Item` | Move item | `Move-Item file.txt D:\` |
| `Remove-Item` | Delete item | `Remove-Item -Recurse` |
| `Get-Command` | List commands | `Get-Command *Process*` |
| `Get-Help` | Get help | `Get-Help Get-Process` |
| `Get-Member` | Object members | `Get-Process \| Get-Member` |
| `Where-Object` | Filter objects | `Where-Object {$_.CPU -gt 100}` |
| `Select-Object` | Select properties | `Select-Object Name, CPU` |
| `Sort-Object` | Sort objects | `Sort-Object CPU -Descending` |
| `ForEach-Object` | Loop objects | `ForEach-Object {$_.Name}` |
| `Test-Connection` | Ping | `Test-Connection google.com` |
| `Get-ADUser` | Get AD user | `Get-ADUser -Identity jdoe` |
| `New-ADUser` | Create AD user | `New-ADUser -Name "John Doe"` |
| `Set-ADUser` | Modify AD user | `Set-ADUser -Identity jdoe` |
| `Get-ADComputer` | Get AD computer | `Get-ADComputer -Filter *` |
[See our PowerShell tutorials for 200+ detailed cmdlet guides]
---
## Command Equivalents
### File Operations Across Platforms
| Task | Windows (CMD) | PowerShell | Linux (Bash) |
|------|--------------|-----------|--------------|
| List files | `dir` | `Get-ChildItem` | `ls` |
| Copy file | `copy src dst` | `Copy-Item src dst` | `cp src dst` |
| Move file | `move src dst` | `Move-Item src dst` | `mv src dst` |
| Delete file | `del file` | `Remove-Item file` | `rm file` |
| View file | `type file` | `Get-Content file` | `cat file` |
| Find text | `find "text" file` | `Select-String "text" file` | `grep "text" file` |
| Create folder | `mkdir folder` | `New-Item -ItemType Directory` | `mkdir folder` |
| Remove folder | `rmdir /S folder` | `Remove-Item -Recurse` | `rm -rf folder` |
| Change dir | `cd path` | `Set-Location path` | `cd path` |
| Print dir | `cd` | `Get-Location` | `pwd` |
---
## Frequently Asked Questions
**Q: What's the difference between CMD and PowerShell?**
A: CMD is the legacy Windows command line (from 1981), text-based and limited. PowerShell (2006+) is a modern automation framework, object-based with extensive scripting capabilities. For new projects, use PowerShell—it's more powerful, has better scripting, and works cross-platform (PowerShell 7+).
**Q: How do I run PowerShell scripts?**
A: Save code as `.ps1` file, then run: `.\script.ps1`. You may need to set execution policy first: `Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser`
**Q: Can I use Linux commands on Windows?**
A: Yes, via Windows Subsystem for Linux (WSL). Install from Microsoft Store: `wsl --install`. This provides a full Linux environment on Windows.
**Q: How do I find what a command does?**
A:
- CMD: `commandname /?` (e.g., `dir /?`)
- PowerShell: `Get-Help cmdletname` (e.g., `Get-Help Get-Process`)
- Bash: `man command` or `command --help`
**Q: How do I redirect output to a file?**
A:
- CMD/Bash: `command > file.txt` (overwrite) or `command >> file.txt` (append)
- PowerShell: `command | Out-File file.txt` or `command >> file.txt`
---
## Related Resources
### Windows Command Line
- CMD Tutorials - 26 detailed CMD guides
- PowerShell Tutorials - 200+ PowerShell guides
- [PowerShell Complete Guide](/complete-powershell-guide) - Comprehensive PowerShell tutorial
### Active Directory
- [Active Directory Guide](/complete-active-directory-guide) - Complete AD tutorial
- Active Directory Tools - AD management tools
- [Dsquery Examples](/dsquery) - AD query commands
- [Dsacls Guide](/dsacls) - AD permissions management
---
**Last Updated**: February 4, 2026
**About**: This command line reference is maintained by ActiveDirectoryTools.net to help IT professionals quickly find command syntax and examples across Windows and Linux platforms.
Use the search function (Ctrl+F) to quickly find specific commands. Bookmark this page for quick reference!
---
**Keywords**: command line reference, cmd commands, powershell commands, bash commands, windows commands, terminal commands, shell commands, command prompt, powershell cmdlets, linux commands, system administration