Command Line Flashcards
tasklist
Displays a list of currently running processes
taskkill
Terminate tasks by process ID (PID) or image name
expand
used to extract a single file or a group of files from a compressed file
expand /d
This option lists the files contained in the source but does not extract them.
expand /f: (file name)
The name of the file that you want to extract from the source file.
*If the source only contains one file, this option isn’t necessary.
gpupdate
Force a group policy update
gpresult
Verify policy settings for a computer or user
copy /v
copies and verifies that new files are written correctly
copy /y
suppresses the confirmation prompt displayed when Windows is about to overwrite the contents of an existing file
xcopy
copy one or more files and/or folders from one location to another location. NTFS permission not preserved
robocopy
copy one or more files and/or folders from one location to another location & Preserves NTFS permissions
md or mkdir
Make directory in windows
cd
Change directory
rd or rmdir
Remove directory
dir or dir *.*
Directory listing, list files and directories
chkdsk /r
locate bad sectors and recover any readable information from them.
chkdsk /f
Fixes logical errors on the disk
format
Format a disk, prepare for use by the OS
diskpart
Disk Partitioner
shutdown
Shutdown computer
ping
test the reachability of a host across an IP network
shutdown /t 60
The command for setting the time-out period of 60 seconds before powering off a Windows host
Right-clicking on the Command Prompt application icon allows for execution of
shell commands reserved for a system administrator.
netdom
command-line command for managing Active Directory domains
net use
used to connect to, remove, and configure connections to shared resources, like mapped drives and network print
net view
Displays a list of domains, computers, or resources that are being shared by the specified computer.
net stop “print spooler”
an example of how you’d stop the Print Spooler service from the command line. Services can also be controlled via (services.msc) tool in Windows
net start
useful if you want to see a list of currently running services
shutdown /r
Windows Command Prompt forces full system shutdown and restart of the Windows host
[command name] /?
displays help information related to a specific command-line utility
Esc
allows to stop the execution of the current command run in Windows Command Prompt
sfc /scannow
scan all protected operating system files and repair as necessary.
sfc /verifyonly
This sfc command option is the same as /scannow but without repairing.
sfc /scanfile=file
scan and repair a specified file
CD\ or CHDIR\
change(s) the current directory to the root directory OR specific directory if specified
cls
clears the Command Prompt window screen in Windows
nslookup
Verify that the computer can connect to a DNS server and successfully find an IP address for a given computer name.
taskkill /pid
Specifies the process ID of the process to be terminated.
taskkill /im
Specifies the image name of the process to be terminated. Use the wildcard character (*) to specify all image names.
exit or taskkill /IM cmd.exe
exit(s) the command interpreter in Windows
bootrec /fixmbr
writes a new master boot record to a disk
REGSVR32
for registering and unregistering DLLs and ActiveX controls in the Windows Registry
BOOTREC /FIXBOOT
writes a new boot sector to the system partition