tips
87 tips Windows
One command, setting or habit at a time about Windows: what it does, the line to copy and a caveat or two.
Windows 87
-
Read a package's publisher, licence and versions before installing it.
winget show --id Git.Git -
A keyboard shortcut that toggles the color filter you picked in Windows settings.
Win+Ctrl+C -
Send the active window to the monitor on the left or right without touching the mouse.
Win+Shift+Left arrow -
Create a desktop, switch between desktops and rename them from the keyboard.
Win+Ctrl+Left arrow -
The taskbar has four shortcut families built on position numbers, from launching to jump lists.
Win+1 ... Win+9 -
Two Print Screen combinations: the active window to the clipboard, or the whole screen to a file.
Alt+PrtScn -
Pick a window layout from the keyboard, then fill the rest of the screen.
Win+Z -
A shortcut that switches the high contrast theme on and off in Windows.
Left Alt + Left Shift + Print Screen -
Lists every TCP port Windows is listening on, with the process ID that owns each one.
Get-NetTCPConnection -State Listen -
Lists installed Windows hotfixes, or checks for one specific KB number.
Get-HotFix -
Set a delayed shutdown for Windows and cancel it if you change your mind.
shutdown /s /t 3600 /c "Backup should be done by now" -
See which sleep and hibernate modes the machine offers and why others don't.
powercfg /a -
Fetch an app's installer to a folder for later or another PC.
winget download --id Microsoft.PowerToys -
Create an HTML report of recent Wi-Fi sessions, errors and disconnect reasons.
netsh wlan show wlanreport -
Run a downloaded PowerShell script you checked, without loosening the execution policy.
Get-Item * -Stream Zone.Identifier -ErrorAction SilentlyContinue -
Find the PowerShell scope whose policy wins, before changing anything.
Get-ExecutionPolicy -List -
Check encryption state, progress and key protectors for every drive.
manage-bde -status -
Save a whole WSL distribution to a tar file you can import again.
wsl --terminate Ubuntu -
Avoid the alias that turns curl into Invoke-WebRequest and breaks copied commands.
curl.exe -I https://example.com -
Shows only the usage examples of a cmdlet instead of the full help text.
Get-Help Get-ChildItem -Examples -
Point a Windows network adapter at your own DNS server from PowerShell and undo it later.
Get-DnsClientServerAddress -AddressFamily IPv4 -
Puts two or more shells side by side in one Windows Terminal tab.
Alt+Shift+Plus new pane to the right (vertical split) -
Makes the current window stand out in the status bar.
setw -g window-status-current-style 'bg=yellow,fg=black,bold' -
Moves the current window to a new index or another session.
Ctrl-b . -
Goes straight to the window that rang a bell or printed output.
Ctrl-b Alt-n -
Reaches windows numbered above 9 without cycling through them.
Ctrl-b ' -
Call a REST API and work with the fields directly, without parsing JSON yourself.
$r = Invoke-RestMethod https://api.github.com/repos/PowerShell/PowerShell/releases/latest -
Shows the current folder instead of the program in window names.
setw -g automatic-rename-format '#{b:pane_current_path}' -
Starts a command in a new window while you stay where you are.
tmux new-window -d -n sync 'rsync -a ~/photos/ /mnt/backup/photos/' -
Makes Up and Down in PowerShell return only commands that start with your text.
Set-PSReadLineKeyHandler -Chord UpArrow -Function HistorySearchBackward -
Shows the last lines of a file and keeps printing new ones as they are written.
Get-Content -Path C:\Logs\app.log -Tail 20 -Wait -
Lists where a program or file is found on PATH, in the order Windows uses it.
where python -
Empties the DNS cache on the Windows PC so names are looked up again.
ipconfig /flushdns -
Creates a directory junction so a folder appears under a second path.
mklink /J "C:\Games\SaveData" "D:\Storage\SaveData" -
Lists the services running inside each process, filtered by name, PID or memory use.
tasklist /svc /fi "IMAGENAME eq svchost.exe" -
Prints a few lines before and after every match in a text file.
Select-String -Path C:\Temp\app.log -Pattern 'error' -Context 2,3 -
Lists only the files in a folder tree whose text contains a pattern.
Select-String -Pattern 'example.com' -List | -
Measures packet loss at every router between your PC and a destination.
pathping /n example.com -
Lists the programs and drivers that stop Windows from sleeping or turning off the display.
powercfg /requests -
Starts one program with administrator rights from a normal PowerShell window.
Start-Process -FilePath "powershell" -Verb RunAs -
Shows what woke the PC from sleep and which devices are allowed to wake it.
powercfg /lastwake -
Observes an idle PC for a minute and writes an HTML report on power problems.
powercfg /energy -
Finds files by name under a folder, or shows which copy of a program is on your PATH.
where /r C:\Users\Public *.log -
Swaps the positions of two tmux windows.
tmux swap-window -s 3 -t 1 -
Creates a new tmux window directly after the current one instead of at the end.
tmux new-window -a -
Finds the tmux window whose name, title or visible text matches a pattern.
tmux find-window 'Permission denied' -
Highlights a tmux window in the status bar after it has printed nothing for a set time.
tmux setw monitor-silence 30 -
Sizes a tmux window to the sessions that have it as current window.
setw -g aggressive-resize on -
Stops tmux from renaming windows after the program running in them.
set-option -wg automatic-rename off -
Switches to a tmux window with the given name if it exists, and creates it if it does not.
tmux new-window -S -n logs 'tail -f /var/log/syslog' -
Puts one running tmux window in a second session, without starting it twice.
tmux link-window -s work:logs -t home: -
Shows crashes, failed updates and installs per day, with a stability score from 1 to 10.
perfmon /rel -
Shows PowerShell's history-based command suggestions as a pick list instead of grey text.
Set-PSReadLineOption -PredictionViewStyle ListView -
Opens a Windows Terminal window that slides down from the top and hides again on a key.
wt -w _quake -
Runs a PowerShell command and reports how long it took to finish.
Measure-Command { Get-ChildItem -Path C:\Windows\*.txt -Recurse } -
Opens command output in a filterable window and passes the rows you select onward.
Get-Process | Out-GridView -PassThru | Stop-Process -
Restarts Windows into the recovery menu or the firmware settings without key mashing.
shutdown /r /o /t 0 -
Scans an NTFS drive for errors online, without locking it or restarting first.
chkdsk C: /scan -
Shows the services a Windows service depends on, and which services depend on it.
Get-Service WinRM -RequiredServices -
Saves the permissions of a folder tree to a file, so you can restore them after a mistake.
icacls D:\Share\* /save D:\acl-backup.txt /t -
Keeps a single app out of winget upgrade --all, or holds it at a version range you pick.
winget pin add --id Microsoft.PowerToys -
Repairs the Windows component store, so sfc has good copies to fix system files with.
sfc /scannow -
Pulls only recent critical and error events from a Windows log, without opening Event Viewer.
Get-WinEvent -FilterHashtable @{LogName='System'; Level=1,2; StartTime=(Get-Date).AddDays(-1)} -
Looks up DNS records from PowerShell, with the record type and DNS server you choose.
Resolve-DnsName example.com -Type MX -Server 1.1.1.1 -
Calculates the SHA256 checksum of a file in PowerShell so you can compare it.
Get-FileHash .\ubuntu.iso -
Shows what a robocopy mirror would copy and delete before it touches any file.
robocopy C:\Data D:\Backup /MIR /L -
Writes your installed Windows apps to a JSON file and reinstalls them elsewhere.
winget export -o apps.json -
Lists connections and listening ports in numeric form with the owning process ID, then tasklist names it.
netstat -ano | findstr :8080 -
Generates an HTML report with battery usage over the lifetime of the system.
powercfg /batteryreport -
Scans protected system files and replaces damaged ones with a cached good copy, from an admin prompt.
sfc /scannow -
Shows detailed configuration of the computer and its operating system in a Command Prompt window.
systeminfo -
Lists the IPv4 or IPv6 addresses configured on each network interface of a Windows PC.
Get-NetIPAddress -AddressFamily IPv4 | Format-Table InterfaceAlias, IPAddress, PrefixLength -
Tests from PowerShell whether a remote TCP port accepts connections, and shows the ping result as well.
Test-NetConnection -ComputerName example.com -Port 443 -
Opens a panel with emoji and symbols that you can search while you are typing in any app.
-
Lists the installed WSL distributions with their state and whether they run on WSL 1 or WSL 2.
wsl --list --verbose -
Resets the Windows graphics driver with one key combination, which can wake a frozen or black screen.
-
Shows the last things you copied, so you can paste an older one instead of copying it again.
-
Switches to a window by its number, shown in the status bar, with two key presses.
Ctrl-b 0 -
Marks a window in the status bar when something new appears in it while you look elsewhere.
setw -g monitor-activity on -
Moves to the next or the previous window in the session with a single key after the prefix.
Ctrl-b n # next window -
Gives the current tmux window a name you choose, so the status bar tells you what is running where.
Ctrl-b , -
Closes the current tmux window and every pane in it, but asks first.
Ctrl-b & -
Lists the Windows app updates that are waiting, and updates one app or all of them.
winget upgrade -
Renumbers tmux windows automatically so there is no gap after one is closed.
set -g renumber-windows on -
Toggles between the current and the previous tmux window, like alt-tab for windows.
Ctrl-b l # last window -
Opens a list of all tmux sessions and windows with a preview, so you can jump to any of them.
Ctrl-b w # sessions and windows -
Starts numbering tmux windows at 1, so the first window sits under the 1 key.
set -g base-index 1
Nothing in this filter yet.