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
reg
allows for editing Windows registry from the Command Prompt
del or erase
can be used to delete one or more files
rd /s
allows for the deletion of the specified directory and all its subdirectories, including all files)
A wildcard character that can be used as a substitute for a single character in a file or directory name
?
A wildcard character that can be used as a substitute for any string of characters in a file or directory name
*
bootrec /rebuildbcd
contains a detailed list of what is supposed to load at startup. Use this to completely rebuild the BCD.
NETSTAT
Show the status of each active network connection
tracert
Determine and test all points along the route the computer uses to send a packet to a destination.
If TRACERT is unsuccessful
you can use the results generated to determine at what point communications are failing.
IPCONFIG /RELEASE
Release the IP addressing information assigned to the computer by the DHCP server or APIPA.
IPCONFIG /RENEW
will Lease IP addressing information from a DHCP server or APIPA.
IPCONFIG /FLUSHDNS
Clear DNS info so that the computer updates with new configuration info
also used for troubleshooting in situations where the client has incorrect DNS info
IPCONFIG /REGISTERDNS
Register the client with its DNS server
r
Displays a list of currently running processes
tasklist
r
Terminate tasks by process ID (PID) or image name
taskkill
r
used to extract a single file or a group of files from a compressed file
expand
r
This option lists the files contained in the source but does not extract them.
expand /d
r
This is 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.
expand /f: (file name)
r
Force a group policy update
gpupdate
r
Verify policy settings for a computer or user
gpresult
r
copies and verifies that new files are written correctly
copy /v
r
suppresses the confirmation prompt displayed when Windows is about to overwrite the contents of an existing file
copy /y
r
Copies multiple files and directory trees
xcopy
r
copy one or more files and/or folders from one location to another location & Preserves NTFS permissions
robocopy
r
Make directory in windows
md or mkdir
r
Change directory
cd
r
Remove directory
rd or rmdir
r
Directory listing, list files and directories
dir or dir *.*
r
locate bad sectors and recover any readable information from them.
chkdsk /r
r
Fixes logical errors on the disk
chkdsk /f
r
Format a disk, prepare for use by the OS
format
r
Disk Partitioner
diskpart
r
Shutdown computer
shutdown
r
test the reachability of a host across an IP network
ping
r
The command for setting the time-out period of 60 seconds before powering off a Windows host
shutdown /t 60
r
command-line command for managing Active Directory domains
netdom
r
Displays a list of domains, computers, or resources that are being shared by the specified computer.
net view
r
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 stop “print spooler”
r
useful if you want to see a list of currently running services
net start
r
Windows Command Prompt forces full system shutdown and restart of the Windows host
shutdown /r
r
can be used to display help information related to a specific command-line utility
[command name] /?
r
allows to stop the execution of the current command run in Windows Command Prompt
Esc
r
scan all protected operating system files and repair as necessary.
sfc /scannow
r
This sfc command option is the same as /scannow but without repairing.
sfc /verifyonly
r
scan and repair a specified file
sfc /scanfile=file
r
change(s) the current directory to the root directory
CD\ or CHDIR\
r
clears the Command Prompt window screen in Windows
cls
r
Verify that the computer can connect to a DNS server and successfully find an IP address for a given computer name.
nslookup
r
Specifies the process ID of the process to be terminated.
taskkill /pid
r
Specifies the image name of the process to be terminated. Use the wildcard character (*) to specify all image names.
taskkill /im
r
exit(s) the command interpreter in Windows
exit or taskkill /IM cmd.exe
r
writes a new master boot record to a disk
bootrec /fixmbr
r
for registering and unregistering DLLs and ActiveX controls in the Windows Registry
REGSVR32
r
writes a new boot sector to the system partition
BOOTREC /FIXBOOT
r
allows for editing Windows registry from the Command Prompt
reg
r
can be used to delete one or more files
del or erase
r
allows for the deletion of the specified directory and all its subdirectories, including all files)
rd /s
r
scans all disks for Windows installations and displays entries currently not in the BCD store
bootrec /scanos
r
Show the status of each active network connection
NETSTAT
r
Determine and test all points along the route the computer uses to send a packet to a destination.
tracert
r
Release the IP addressing information assigned to the computer by the DHCP server or APIPA.
IPCONFIG /RELEASE
r
will Lease IP addressing information from a DHCP server or APIPA.
IPCONFIG /RENEW
r
Clear DNS info so that the computer updates with new configuration info
also used for troubleshooting in situations where the client has incorrect DNS info
IPCONFIG /FLUSHDNS
r
Register the client with its DNS server.
IPCONFIG /REGISTERDNS
r
used to connect to, remove, and configure connections to shared resources, like mapped drives and network print
net use
Used without parameters, net view displays a list of ____?
computers in your current domain.