#echo
Print text
echo textecho HelloCMDPrint a line
echo %USERNAME%CMDPrint a variable in CMD
echo New line >> notes.txtCMDAppend to a file
Write-Output "Hello $env:USERNAME"PowerShellPowerShell
SSH Command in Windows with examples
Small commands that make the window faster, and the first steps of scripts.
echoPrint text
echo textecho HelloCMDPrint a line
echo %USERNAME%CMDPrint a variable in CMD
echo New line >> notes.txtCMDAppend to a file
Write-Output "Hello $env:USERNAME"PowerShellPowerShell
help / Get-HelpRead the help
help [command]helpCMDList built-in commands
dir /?CMDHelp for one command
Get-Help Get-ChildItem -ExamplesPowerShellExamples for a PowerShell command
Get-Command *service*PowerShellFind commands by word
clsClear the screen
clsclsCMDClear CMD (PowerShell also accepts cls or Clear-Host)
doskey / Set-AliasMake a shortcut
doskey name=command $*doskey ll=dir /a $*CMDNow ll lists everything (this window only)
Set-Alias ll Get-ChildItemPowerShellPowerShell alias
redirects and pipesConnect commands
> >> | 2>dir > list.txtCMDWrite output to a file (replaces it)
dir >> list.txtCMDAppend instead
command 2> errors.txtCMDSave only error messages
ipconfig | findstr IPv4CMDPipe one command into another
Batch filesYour first script
name.batnotepad hello.batCMDCreate a file with @echo off on line 1 and echo Hello on line 2
hello.batCMDRun it
for %f in (*.jpg) do echo %fCMDDo something for every jpg (inside a .bat file use %%f)
PowerShell scriptsYour first PowerShell script
name.ps1Set-ExecutionPolicy -Scope CurrentUser RemoteSignedPowerShellAllow your own scripts to run
foreach ($f in Get-ChildItem *.jpg) { $f.Name }PowerShellLoop over files
.\hello.ps1PowerShellRun a script in the current folder
if / gotoTests and jumps
if exist file commandif exist notes.txt echo yesCMDTest for a file
if "%1"=="" echo Missing argumentCMDTest an argument in a script
timeoutWait
timeout /t secondstimeout /t 10CMDWait ten seconds
Start-Sleep -Seconds 10PowerShellPowerShell
exitClose the window or session
exitexitCMDLeave CMD, PowerShell or an SSH session
SSH Command is a desktop app for Mac, Windows and Linux that puts a real terminal, SFTP file panes, a sudo switch and a searchable Linux command finder in one window. Type what you want to do, and send the command to your server with one click.
Download free Linux commands with examples SFTP & FTP client