1.5 - Windows cmd CLI Flashcards

(48 cards)

1
Q

In cmd occasionally need to type certain commands in elevated privileges. How would you do this?

A

Run cmd as an administrator.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is a keyboard shortcut for running cmd as admin?

A

Ctrl + Shift + Enter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What’s the cmd command to change directory?

A

cd or chdir
use a backslash to specify the volume or folder name

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What’s the cmd command to list all the contents of a directory?

A

dir

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What command in cmd can you use to list out details on how a command works?

A

help
i.e. help dir, help chkdsk, help sfc, etc… - you can also use [command] /? like: dir /?, chkdsk /?, sfc /?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which cmd command can you type to navigate back one working directory?

A

cd { _ } ..

(2 dots/full-stops)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which cmd command can be used to make a directory?

A

mkdir or md

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Which cmd command can be used to change the directory you are in?

A

chdir or cd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Which cmd command can be used to remove/delete a directory?

A

rmdir or rd

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which key can you press in the Windows command prompt that autocompletes a word?

A

Tab

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

In MS Windows what is used in a filepath in place of a forward slash to separate the hight and lower level of the directory tree?

A

Backslash “ \ “

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Which cmd command can be used to ensure that the files on a disk are ok (if using NTFS)?

A

chkdsk

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

When running the chkdsk command in cmd, what attribute should you also add that fixes the files after they are checked?

A

chkdsk /f

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What security priviledge is needed to use the chkdsk /f command in cmd?

A

Admin
Run cmd as aministrator (Ctrl + Shift + Enter)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Which attribute of the cmd command “chkdsk” can be used to locate bad sectors of a drive and recovers readable information?

A

chkdsk /r
this implies /f

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Which cmd command can be used to wipe a drive entriely and get a new and clear FS on it?

A

format

BE CAREFUL AS YOU CAN LOSE DATA! CREATE A BACKUP BEFORE! - do your backup of the whole system just in case you type an incorrect drive letter

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Which cmd command can be used to manage the disk configurations in a Windows system?

A

DiskPart

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

The DiskPart utility in Windows requires which privileges to execute the command in cmd?

A

For most things you’ll need to “Run as administrator”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Which cmd command is used to duplicate a file?

A

copy
/v - verifies the new files are written correctly.
/y - suppresses prompting to confirm you want to overwrite an existing destination file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What’s the syntax to use the cmd command “copy”?

A

copy file_name drive_letter
e.g. copy thedoes.pdf j:

The drive letter is for the destination of the copied file.

21
Q

Use the cmd “copy” command to copy “jane.pdf” to the d drive

A

copy jane.pdf d:

22
Q

Use the cmd “copy” command to copy “john.pdf” to the d drive

A

copy john.pdf d:

23
Q

Which cmd command has been introduced in later versions Windows (10/11) that creates a “robust copy”?

24
Q

Why use “robocopy” instead of “copy”?

A

There are many more options available with “robocopy”

25
Use the cmd "copy" command to copy "john.pdf" to the d drive ensuring the file is also verfied.
copy /v john.pdf d:
26
Use the cmd "copy" command to copy "john.pdf" to the d drive ensuring the file is also verfied and the prompt to overwrite is bypassed.
copy /v /y john.pdf d:
27
Which cmd prompt can be used to view the name of the device that you're using?
hostname
28
How do you change a Windows device's hostname?
In the **system settings**.
29
Which cmd command can be used to view the Windows OS Version of the machine you're working on?
winver
30
Which cmd command can be used to see which user account you're using?
whoami
31
How would you get every bit of information about the user account you're using?
whoami /all
32
What is usually **updated at login** regarding security for a PC that's part of an AD domain?
**Group Policy**
33
Using cmd on windows which prompt can be use to force a group policy update?
gpupdate Syntax: gpupdate /target:{computer|user} /force gpupdate /target:user /force
34
Which cmd prompt can be used to verify which group policy settings are currently active for a computer or user?
gpresult /r
35
Which cmd prompt can be used to scan the integrity of all protected system files?
sfc *use /scannow*
36
Which cmd prompt is used to display all IP config info?
ipconfig
37
Which protocol does **ping** use?
Internet Control Message Protocol (ICMP)
38
Which cmd prompt is used to display the network statistics?
netstat
39
When using the netstat command in cmd what attribute can be added to show all active connections?
-a *netstat -a*
40
When using the netstat command in cmd what attribute can be added to show the binary info of the active connections?
-b *netstat -b*
41
Which privilege do you need to run **netstat -b**?
Elevated
42
When running the netstat cmd prompt (Windows) it will show the DNS name by default. Which attribute can be used to ensure it'll only show the IP address?
-n *netstat -n*
43
Which cmd prompt can be used to find information of DNS servers (in a Windows cmd prompt)?
nslookup
44
Which cmd prompt can be used in a Windows OS to view various network info?
net
45
When using the **net** cmd prompt in a Windows OS what would be the syntax to view network resources?
net view \\serverName\ net view \workgoup: workgroupName
46
When using the **net** cmd prompt in a Windows OS what syntax can be used to map a network drive?
net use drive: \\ {serverName} \ {shareName}
47
When using the **net** cmd prompt in a Windows OS what syntax can be used to view user account information and reset passwords?
net user {username} net user {username} * /domain
48