BatchBashDescription
command /?man commandShows the help for command
bitsadminwget or curlDownloads a remote file
certutil -hashfile file_name MD5md5sum file_nameGets the MD5 checksum of file_name
cdpwdDisplays the current directory
cd directorycd directoryChanges the current directory to the specified one
clsclearClears the screen
copycpCopies a file or files from a source path to a target path
datedateDisplays the date or sets it based on user input
delrmDeletes a file or files
dirlsdisplays a list of files and directories in the current directory
echoechoDisplays text on the screen
exitreturnExits a script or subroutine
exitlogoutCloses the command prompt or terminal
fcdiffCompares the contents of two files
find "string" file_namegrep "string" file_nameSearches file_name for string
findstr "string" file_namegrep "string" file_nameSearches file_name for string
for /F %A in (fileset*) do somethingfor item in fileset*; do; something; doneDo something for every file in a set of files
for /F %A in ('command') do something`command`Returns the output of a command
for /L %A in (first,increment,last) do somethingfor item in `seq first increment last`; do; something; doneStarts at first and counts by increment until it reaches last
forfilesfindSearches for files that match a certain criteria
if "%variable%"=="value" (if [ "variable"="value" ]; thenCompares two values
ipconfigifconfigDisplays IP information
mdmkdirCreates new folders
mklinkln -sCreates a symbolic link
moremoreDisplays one screen of output at a time
movemvMoves a file or files from a source path to a target path
pauseread -p "Press any key to continue"Pauses script execution until the user presses a button
popdpopdRemoves the top entry from the directory stack and goes to the new top directory
pushdpushdAdds the current directory to the directory stack and goes to the new top directory
renmvRenames files
rem or ::#Comments a line of code
rdrmdirRemoves empty directories
rd /srm -rfRemoves directories regardlesss of whether or not they were empty
set variable=valuevariable=valueSets the value of variable to value
set /a variable=equationvariable=$((equation))Performs math (batch can only use 32-bit integers)
set /p variable=promptstringread -p "promptstring" variableGets user input and stores it in variable
shiftshiftShifts arguments by 1 (or n if provided)
sortsortSorts output alphabetically by line
tasklistpsShows a list of running processes
taskkill /PID processidkill processidKills the process with PID processid
time /tdateDisplays the current time
typecatDisplays the contents of a file
wherewhichSearches the current directory and the PATH for a file or command
whoamiidDisplays the name and group of the current user