Microsoft Command Line Tools( Comptia Objective 1.4) Flashcards
In command prompt in windows what are the standard privileges?
- Run applications as normal user
- This works fine for most commands
In order to run command prompt as an administrator in windows what must you first do?
- 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”
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?
- “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”.
Command help can also be accessed using what after the [command]
- / ? will show a list of commands associated with said command.
What does the “dir” command do?
- Lists files and directories inside a folder or storage location.
“cd” command does what exactly?
- Changes working directory.
- Use backslash \to specify volume or folder name.
How would you tell Command Prompt to change directory to folder just above the one you’re already in?
- ” ..” Two dots/periods.
What command would you use to shut down/ or delayed shutdown?
- ” 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.
What command would you use to Shutdown then restart after a certain number of seconds?
- ” shutdown /r /t then the number of seconds.
How can you go up more than one directory?
- 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 can you try and auto complete a command for a directory?
- 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.
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?
- 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 can you list the contents of a directory that you are not inside of?
- 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 can you list a list of the hidden files and directories inside of a folder(directory)
- 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.
If your command prompt screen is cluttered and you want to clean it up what command can you type to achieve this?
- Type “cls” this will clear the screen leaving you with just the one active command line that you are on.
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?
- 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”
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?
- 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.
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?
- Just type the name of the file including the file extension and it will open using the default program for that file.
How would you go about making a new directory using Command prompt?
- 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.
What command would you use to delete a directory inside of Command prompt?
- Type “rmdir” for Remove Directory.
- Note this will only work if that directory has no other directories inside of it.