Use Command-line Tools Flashcards
Lesson 11C (42 cards)
processes the legacy command set that has been part of Windows since its earliest versions.
command shell
cmd.exe
Right-click the command prompt shortcut/select Run as administrator/confirm UAC
Run as administrator
refers to the specific structure and rules that dictate how commands are written and executed to perform tasks.
Command Syntax
–help or /?
If you enter help Command, the help system lists the syntax and switches used for the command
command syntax
can also display help on a particular command
?
command syntax
The string before > in the command prompt shows the working
directory path
command
To list the files and subdirectories from either the working drive and directory or from a specified path.
dir
wildcard character
a placeholder that represents one or more unknown characters, enabling flexible pattern matching in searches or queries.
Example: c?t would find “cat”, “cot”, but not “cart”.
comand
is used to set the focus to a different working directory.
Ex. cd C:\Users\David
cd
- parent directory
- root directory
dir
just enter the drive letter followed by a colon and press ENTER.
ex. D: changes to the D drive. The prompt will change to D:> indicating that the default
drive is now drive D.
Changing the Current Drive
commands
Both commands use a three-part syntax: command\ Source\ Destination. Where ability to transfer files
contained in a single directory.
move/copy
command
is a utility that allows you to copy the contents of more than one directory at a time and retain the directory structure.
as follows: xcopy Source [Destination] [Switches
xcopy
command
To create a directory
ex. md A:\Data\Docs
md
Disk managment
create, delete and extend volumes, assign drive letters, make partition active.
diskpart
command
writes a new file system to a drive. This process deletes any data existing on the drive.
format
scans the file system and/or disk sectors for faults and can attempt to repair any problems detected.
chkdsk
System Management Commands
shutdown
can be used to safely halt the system or log out
* shutdown /s
* shutdown /a - abort
* shutdown /h- hibernate
* shutdown /l - log off
* shutdown /r- restart
repair
System File Checker utility (sfc)
provides a manual interface for verifying system files and restoring them from cache if they are found to be corrupt or damaged
repair
System File Checker utility (sfc)
basics:
- sfc /scannow- scans immediately
- sfc /scanonce -scan at restart
- sfc /scanboot- scans each time pc boots
command
reports version information winver
winver
“switch” can be a physical network device managed via a CLI, it can also be a modifier or option used with commands within any CLI environment.
Ex. [ ls -l ]** ls** is the command to list directory contents, and ** -l **is a switch that modifies the command to display a long listing format switch
switch
-
Angle brackets
< >
mark required placeholders, -
Square brackets
[ ]
indicate optional elements, -
Curly brackets
{ }
with vertical bars|
show required, mutually exclusive choices, - and Ellipses
...
allow repetition of the preceding item.
Syntax Notations
<command> [arguments] [options]
where the command is the main action, arguments are positional inputs, and options are modifiers prefixed with -
or --
that may include values.
Command syntax format