Show Menu
Cheatography

Windows Command Line-Basic Cheat Sheet (DRAFT) by

general command line entries

This is a draft cheat sheet. It is a work in progress and is not finished yet.

File Mgmt

copy filepath from filepath tp
| copy file from one location to another
del file1 file2 file3
| deletes file
edit
| starts file editor
move c:\f1­\tex­t.txt c:\f2
| move files from one directory to another
type
displays contents of text file
print
| prints out text file contents
ren
| renames file
find
| locates texts string in file
fc file1 file2
| displays file comparison
robocopy
| advanced tool to copy files
replace
| overwrites a file of the same name
openfiles
| manages opened local/­network files

Directory Mgmt

tree
| displays directory structure
md zabbix
| make directory
rd
| removes directory
rd zabbix
| removes directory
rd /s Folder
| force remove directory
rd /s /q folder
| force remove directory without prompt
ren zabbix zabbix­-test
| renames directory
robocopy
| advanced tool to copy direct­ories
expand
| decomp­resses files

Process Mgmt

schtasks
| executes a command
shutdown
tasklist
taskkill
reg
runas
 

Basic Commands

cd | change directory
date | display or edit date
cd ..
| up one level
dir | display contents of current directory
time | display or edit time
cls | clears the screen
drivequery | current state of device driver
cmd | opens a second command prompt
hostname | name of current node
color
systeminfo | display config­uration info
prompt
ver | dispaly windows version
title
gpresult | display current group policies
exit
gpupdate | update group policies
dir /A c:\apps
| display all files & folders in c:\apps
dir /A;D
| display only folders
dir /A:-D
| display only files
dir /A:H
| Display hidden files
dir /o
| display alphab­eti­cally
dir /o:s
| display files smallest to pargest
dir /o:-s
| display files largest to smallest

Disk Mgmt

chkdisk
convert
fformat
hostname
systeminfo
ver

Advanced Commands

attrib
| displa­y/edit file attributes
cacls
| displa­y/edit access control list of file
chkdsk
| displpays disk status report
cmdkey
| create­s/d­isplays stored usernames
color
convert
|
echo
|