Microsoft Command Line Tools( Comptia Objective 1.4) Flashcards

1
Q

In command prompt in windows what are the standard privileges?

A
  • Run applications as normal user

- This works fine for most commands

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

In order to run command prompt as an administrator in windows what must you first do?

A
  • You must be a member of the Administrators group
  • Access by right clicking on Command prompt and choose “ Run as Administrator” accessed typing or searching cmd or “Cntrl+Shift+Enter”.
  • You will know that you’re in administrator command prompt by looking at the top border of the window where it clearly says “ Administrator Command Prompt”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

If you are lost and aren’t sure of a certain command what can you use to get a list of associated commands by inputting what command?

A
  • “help” and then the command that you need help with to get a list of commands associated with the command typed after the word “help”.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Command help can also be accessed using what after the [command]

A
  • / ? will show a list of commands associated with said command.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What does the “dir” command do?

A
  • Lists files and directories inside a folder or storage location.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

“cd” command does what exactly?

A
  • Changes working directory.

- Use backslash \to specify volume or folder name.

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

How would you tell Command Prompt to change directory to folder just above the one you’re already in?

A
  • ” ..” Two dots/periods.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What command would you use to shut down/ or delayed shutdown?

A
  • ” shutdown” to completely shut down the computer instantly.
  • Typing “ shutdown /s to specify a shut down but then type “/t “ nn” to specify number of seconds to delay shutdown then shut down.
  • Alternatively if you wanted to shutdown and then reboot after a certain amount of time you would type “ shutdown /r /t” and then type the number of seconds using the numpad.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What command would you use to Shutdown then restart after a certain number of seconds?

A
  • ” shutdown /r /t then the number of seconds.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How can you go up more than one directory?

A
  • You can type “cd ..” to go up one directory but if you wish to go up more than one you can type “cd../..” this will take you up an additional directory.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How can you try and auto complete a command for a directory?

A
  • You can type the first letter of a folder or directory such as “ d” for Documents and then hit tab and cmd should auto populate a name of a directory that starts with D. If you don’t see the one you were looking for you can just hit tab again until you see the correct command.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When using the “dir” command in Command prompt and you see a list of items that have DIR in front of them and ones that don’t? what does that mean?

A
  • means that the item is a directory( Or folder) with additional items inside. Items that don’t have DIR in front of them that is the end of the file path and there are no more directories inside of them.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How can you list the contents of a directory that you are not inside of?

A
  • You can simply type “ dir” then the directory path of the directory you wanted listed.
  • For example if you are currently in C:\Users\Kevin and wish to see the directory list of the Audio drivers folder inside of “ C:\Users\Kevin\Desktop” you can simply type “ dir Desktop\Audiodrivers” and it will list everything inside of that directory without leaving your current directory. ** Note you do not need a “" before typing “ Desktop” as Desktop is already inside of the directory of “Kevin”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How can you list a list of the hidden files and directories inside of a folder(directory)

A
  • You type “ dir /a” and it will include a list of all the hidden files and directories as well as the regular contents of a directory.
  • Note that this is generally a bad idea to mess around in hidden files and folders as these usually contain very important data that if corrupted could cause system errors.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

If your command prompt screen is cluttered and you want to clean it up what command can you type to achieve this?

A
  • Type “cls” this will clear the screen leaving you with just the one active command line that you are on.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

If you want a list of files inside a directory which are all of the same format( e.g. PDF documents) what command can you use to achieve this?

A
  • Type “ dir *.” Then type the type of specific file format you wanted listed.
  • For example to get a list of all pdf documents inside the current folder you are in could type “ dir *.pdf”
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

If you wish to save some time while typing a commands by using a history list of the last commands used how can you do this?

A
  • You can use the up directional Key on the keyboard and it will list a list of the last used commands. Keep hitting the up directional key to get more of the last used commands.
  • Pressing the down directional key will take you back to the most recently used command.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Once inside of a directory if you want to just open a file using the default program that is listed in that directory how can you do that?

A
  • Just type the name of the file including the file extension and it will open using the default program for that file.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How would you go about making a new directory using Command prompt?

A
  • You would type “ mkdir” and then type any name of the directory that you would like it to be called.
  • Note if you only want to make one directory and you are using more than one word for that directory don’t put spaces between each word because this will create a separate directory for each word that is separated after the “mkdir” command.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What command would you use to delete a directory inside of Command prompt?

A
  • Type “rmdir” for Remove Directory.

- Note this will only work if that directory has no other directories inside of it.

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

What command would you use to delete a directory that has a directory inside of it?

A
  • Type” rmdir /s” put a space afterwards and then type the name of the directory and contents that you would like to be deleted.
22
Q

If you ever want to go back to the beginning or end of a command line typed what can you type to achieve this?

A
  • Use the “ Home” key to go to the beginning of the command

- Use the “ End” key to go to the end of the command .

23
Q

What command can you type to move back to the beginning or end of the last command typed?

A
  • you can hold the Cntrl key and then hit either left to go tot he beginning of the last command or
  • You can hold the Cntrl key and then hit the right directional key to go to the end of the command typed.
24
Q

When trying to add/ delete or specify directories which have longer names with spaces what must you make sure of>

A
  • Have to make sure you put the complete directory path inside of quotation marks.
  • For example to delete a directory on the desktop that has a folder named “ I Love Video Games” you would have to type “ rmdir /s” “Desktop\I Love Video Games” this is the only way to get command prompt to complete the command otherwise it won’t work.
25
Q

What command allows you to list all of the available drives on your computer?

A
  • Type the “ wmic logicaldisk get name” command and it will list all drives connected to your computer.
26
Q

How would you instead of changing directories instead change drives in command prompt?

A
  • Once you know the driver letter assigned to said drive on your computer you can simply type the driver letter( Don’t have to use capital letter) with a : after it
  • For example if you want to switch to a USB flash drive that has been assigned driver letter “F” you would type “ F:” and this will change the active drive that you are in to that USB Flash drive and then you can create, modify and move around directories on that flash drive.
27
Q

If you wanted to show a hierarchal list of a directory showing it’s branches etc what command can you type?

A
  • Type the “tree” command and it will display an almost visual like hierarchal view of a directories structure.
28
Q

If you wanted to see a full list of all the type of file attributes and files associated with them what command can you use?

A
  • You can type “attrib” which will list all of the different file attributes in the directory you are in.
  • You can also type “attrib /?” to get a list of all of the available file attributes commands for a file/folder/directory. These allow you to make changes to a files attributes e.g. change a ready only file into a hidden file etc.
29
Q

How can you change a files attributes such as making a txt. file hidden?

A
  • Type “attrib + h” ( to add hidden file attribute) then add a space and then type the name of the file and it’s extension e.g “ bacon.txt.
  • So full command would be “attrib +h bacon.txt”
  • If you say then wanted to remove the hidden file attribute and add a ready only attribute you could type “ attrib +r -h bacon.txt”( This will add read only attribute and remove hidden file attribute all in one go)
30
Q

What command will allow you to delete a file?

A
  • Simply type “ del” then a space and the name of the file to be deleted. For example to delete a file named bacon on the desktop type “ del bacon.txt”
31
Q

What command could you use to list the text inside of a file inside command prompt?

A
  • Type “type” and then the name of file with extension.

E.G. “ type bacon.txt” This will then show the text that was typed into the file inside the command prompt window.

32
Q

In command prompt how would you go about creating a file based off dir command info displayed on screen or other command info listed into a file?

A
  • You would type the name of the command for instance “dir” then a space then “>” then the name for the file e.g. “porky.txt” so the full command would be as follows :
  • ” dir > porky.txt”
  • **Note this will work for word docs and other types as well.
33
Q

In command prompt how would you go about copying a file into a directory using command prompt?

A
  • You would achieve this using the “copy” command inside of the command prompt then give it two pieces of info first being the name of the file to be copied such as “bacon.txt” and then the a space and the name of the destination directory/folder.
  • E.G. full command woud be “copy bacon.txt testfiles”
  • Note this will also work for copying files to an actual drive for that you would type the same “ copy” command then the name of the file e.g. “ bacon” then type the drive letter e.g “ d:” this will then copy the file to said drive.
34
Q

what command could you use to copy the entire list of files inside a directory to another directory

A
  • You would use the “xcopy” command.
    E.G. “ xcopy testfiles apples” will copy the contents of the testfiles folder into the apples folder on the desktop
  • Note you must be in the same directory as the items being copied or else the source destinations path must be specified. E.G. to copy the contents of the folder named “ testfiles” to your Documents folder you would have to type “ xcopy testfiles C:\Users\User\Documents.
  • Command prompt will then display the items copied over into the destination folder
    ** Note in order to copy over subdirectories inside of the directory to be copied be sure to use the /s after xcopy.
35
Q

What command can be used to copy over the entire contents including sub directories from one directory to another?

A
  • Instead of just using “xcopy” then directory/file name and then the destination directory you would have to use the “ /s” command at the end of the command or after typing “xcopy” to include the sub directories as well as all the other files. E.G. xcopy source destination /s or xcopy /s source destination.
  • ** Note in order to get a sub directory to copy over that is empty you must use the “/e” command at the end of the command instead of “/s”
  • So it basically makes more sense to use the “xcopy” command then the source to be copied, then the destination followed by “ /e”
36
Q

If instead of copying files/directories using copy or the xcopy command you wanted to just move the files/directories what command could you use to achieve this?

A
  • You would use the “move” command.
  • E.g. to move the directory “ Apples” into the “ Testfiles” directory you would just type “ move Apples testfiles” and all of the content in Apples including subdirectories would be copied over.
37
Q

How would you go about renaming a directory in Command Prompt?

A
  • You would use the “rename” command.
  • For example to change the name of the directory “Bullshit2” that’s on the desktop to “ Classy” you would simply type “ rename Bullshit2 Classy”. And it’s as simple as that.
38
Q

What command allows you to abort a shutdown?

A
  • shutdown /a.

- This aborts a scheduled shutdown.

39
Q

what command would you use to find out each and every router that your traffic hits before it get’s to a website?

A
  • In Windows you would type “ tracert”
  • Will tell you every router that your web traffic hit on it’s way to it’s destination.
  • Often many different locations will be shown.
  • Takes advantage of ICMP Time to Live Exceeded error message( The time in TTL refers to hops, not seconds or minutes) for e.g “ TTL=1” is the first router the traffic hit etc.
  • Not all devices will reply with ICMP Time Exceeded Messages
  • Some Firewalls filter ICMP
  • ICMP is low priority for many devices.
40
Q

What command allows you to manage the Deployment Image Servicing and Management tool/ manage windows imaging form(WIM) files?

A
  • “dism”
  • Can make changes to your Windows imaging format image files using the “dism” command.
  • Get information about an image
  • Update applications
  • Manage drivers
  • Manage updates
  • Mount an image etc.
    Note by typing “dism” by itself without any other parameter commands it will give you a list of all of the associated commands related to “dism”
  • Example of checking information on an image file such as an ISO could be done by typing the following:
    “ dism /Get-WimInfo / Wimfile:c:\sources(name of iso image”
41
Q

If you are worried that some of the core OS system files might be corrupted and you want to check on the status what command could you use to do this?

A
  • “sfc” System File Checker
  • This will scan the integrity of all the protected system files
  • This might worth using in the event that you believe your system may have been infected with malware or you think something may have not installed correctly.
  • By simply typing the “sfc” command by itself it will bring up a whole list of commands related to the “sfc” command and what you can do with them. Some examples would be “sfc scannow” which will scan the integrity of all of the protected system files sand repairs files with problems where possible.
42
Q

What command can you use to check the storage drive for any errors or issues?

A
  • “chkdsk”
  • Can you be used with parameter commands such as “ chkdsk /f” this will fix logical system errors on the disk.
  • ” chkdsk /r” is more comprehensive and will check for bad sectors and recover readable information while also fixing logical system errors so it essentially includes a “chkdsk /f” as well.
  • Note it can’t run if you are currently using the drive in which it is to be checking for errors so will check the storage device the next time you reboot the system.
43
Q

Outside of the GUI what command can you use to check on the status of your drive partitions and configurations?

A

“diskpart” this will then take you into the disk partition prompt of the command prompt and then by typing “ list volume” it will display a breakdown list of the drives in use and any partitions that are in place as well as showing possible RAID arrays on the system.
- There are many available diskpart commands by typing Help or /? you will get a list of all of the available commands.

44
Q

You can also manage tasks like you do with the visual “ taskmanager” inside of command prompt how would you go about doing that?

A
  • ” tasklist”. This will display a list of the currently running processes on a system be it local or on a remote machine just like viewing the GUI Task Manager.
  • You can then use the “taskkill” command to terminate tasks by process id(PID) or image name.
    E.G. “ Taskkill” /IM notepad.exe” or to do it using a PID( terminating the notepad which has a PID of 9696) you would type something like “ taskkill /PID 9696/T”.
45
Q

If you ever wanted to force a Group policy update for systems which are say part of an Active Directory Domain which uses group policy how would you do this inside of the command prompt?

A
  • Use the “gpupdate” command. This will allow you to force a Group Policy update. Note you must have command prompt running in Administrator mode to accomplish this.
  • You could then type something like “ gpupdate /target:( Then the name of the computer) / force” to achieve this so for example if you wanted to force a group policy update on a system named “ professor” you would type the following command :
    “gpupdate /target:professor /force”
46
Q

If you wanted to view the group policy settings for a computer or user what command would you use?

A
  • “gpresult” will verify policy settings for a computer or user.
  • An example of this would be to type “gpresult /r” which will list the group policy settings on the system being used.
47
Q

If you wanted to view the group policy settings on a remote device which is not the active one being checked what command would you use instead?

A
  • “gpresult” command then a space and then a forward slash and then the name of the user followed by a space then specify the domain and finally another space and type “ /v” . So for example to check the policy settings for a computer named “professor” on a domain named “ sgc/professor” the entire command would be:
    “ gpresult /professor sgc/professor /v”
48
Q

What’s another useful command used to write a File System to a partition on a drive? Useful when initializing a disk?

A
  • “format” formats a disk for use with windows.
  • Be careful YOU CAN LOSE DATA.
  • If say you have inserted a new flash drive into a usb port which is drive:E to format the drive you would first type “ dir e:” just to make sure there isn’t any data on the drive already and that it’s not formated.
  • If it isn’t formatted already you should get a prompt on the display saying “ The volume does not contain a recognized file system..” . At this point you would type “ format e:” this will then begin formatting the drive using the default settings for file system. E.G. FAT32 or NTFS etc.
49
Q

When copying files over in command prompt and you wanted to verify that the new files are written correctly what command can you use?

A
  • “copy /v” This will verify the new files are written correctly.
  • You would put this command before the name of the file to be copied and the destination name of where it is to be copied to. For example to copy a file named “ bacon.txt” on the desktop to your documents folder while also checking that it copied correctly you would first go to the correct directory then type “ copy /v bacon.txt C:\Users\Name\Documents”
50
Q

If you wish to avoid having to confirm that you want to overwrite an existing destination file how could you do that in Command prompt?

A
  • “copy /y” will suppress the system from having to confirm if you want to overwrite a file.
  • You would put this command before the name of the file to be copied and the destination name of where it is to be copied to. For example to copy a file named “ bacon.txt” on the desktop to your documents folder while also avoiding prompts to confirm an overwrite you would first go to the correct directory then type “ copy /y bacon.txt C:\Users\Name\Documents”
51
Q

What is an even more advanced and slightly better version of the “xcopy” command and why would you use it?

A
  • “robocopy” ( Better version of xcopy)
  • Is included with Windows 7, 8.1 and 10
  • Has the the ability to resume a file transfer if for any reason it was interrupted in the middle of copying stuff over. Useful in areas with intermittent internet connection. ( remote areas)
  • Many of the commands related to robocopy are the same as copy and xcopy. But for a full list you can type “ robocopy /?” to get a full list of the available commands.