Command Line Scripting Flashcards

1
Q

What is unix shell?

A

It is a command line interpreter or shell that provides a command line user interface for unix like operating systems. It is used to execute shell scripts. For example Bash is a unix shell and command language.

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

What are three examples of command line scripting?

A
  1. BASH (Bourne Again Shell)
  2. Command Prompt
  3. PowerShell
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a scripting language?

A

It is a series of commands that tells the program/computer what to do. The code is executed one line at a time.

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

What is syntax?

A

It is just words (not numbers and no decimals). It is a a combination of words and applies to any language, it is part of a script.

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

What is GUI (Graphical User Interface)?

A

It is what the user sees. E.g. website, program. Before GUI we had just a basic command prompt.

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

What can the command prompt be used for?

A

It can be used for gaining statistical data such as an IP address or solving internet connection issues. As well as file and system management e.g. on boarding a new member of staff.

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

What is the command prompt?

A

It allows the user the navigate the file system, launch and terminate processes, perform maintenance and automate tasks using batch files.

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

What is the process running inside the window for command prompt?

A

C:\windows\system32\cmd.exe

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

If you save a file on the command line on windows what does it save as?

A

Exe

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

What are the 3 advantages of the command prompt?

A
  1. When you want to quickly do something you can use the command line within the command prompt e.g. to find pictures on a computer.
  2. When you want to repeat certain tasks many times or at some point in the future. E.g. delete unnecessary files.
  3. If you want to administer a machine remotely. You can use the command line to gain control of a PC remotely.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the 2 disadvantages of the command prompt?

A
  1. When you don’t know the name of the command or what options to make it work, it makes it difficult to use.
  2. When the thing you want to automate requires user input. E.g. selecting a default printer. You cannot use it this way.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What can PowerShell be used for, and what built-in scripting language does it contain?

A

To automate tasks and configure operating systems such as Windows. It is based on the .NET framework.

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

What is the language used in PowerShell?

A

Commandlets

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

What is the file extension for a PowerShell script?

A

PS1

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

What is BASH, and what can it be used for?

A

It stands for Bourne Again Shell. It is based on UNIX operating systems such as Linux and Mac OS. Examples include Bash, Dash, Sh, Ksh. It can be used to manage routine tasks and file management. It is different from PowerShell/Command Prompt.

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

What is Linux?

A

It is an operating system like MAC, Windows etc. Linux is open to anyone. It allows everyone to create their own version of Windows and MAC. Therefore, there are a lot of security risks associated with it.

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

What is an Internal Command Prompt?

A

They are built into cmd.exe and do not exist as separate executable files. So when you enter a command. The interpreter tries to match what you typed into a recognised command.

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

What are External Command Prompts?

A

They are separate executable files that exist on the operating system’s storage device. It requires a separate file to operate.

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

What is the internal command prompt Md/Mkdir?

A

It means make directory. Mk means make. It means making a new file directory.

20
Q

What is the internal command prompt Dir?

A

Directory is a command used for finding computer files and directory listings. Dir is directory listing.

21
Q

What is the internal command prompt Echo?

A

Display text.

22
Q

What is the internal command prompt Cls?

A

Clear the screen

23
Q

What is the internal command prompt Color?

A

Change colours.

24
Q

What is the internal command prompt Copy?

A

Copy a file.

25
Q

What is the internal command prompt Date?

A

Show the current date.

26
Q

What is the internal command prompt Exit?

A

Close the command prompt.

27
Q

What is the internal command prompt For?

A

Run commands in a loop.

28
Q

What is the internal command prompt Goto?

A

Jump to a section of the script

29
Q

What is the internal command prompt If?

A

Perform different actions

30
Q

What is the internal command prompt Move?

A

Move a file.

31
Q

What is the internal command prompt Path?

A

Set the %PATH%

32
Q

What is the internal command prompt Pause?

A

Wait for a key press.

33
Q

What is the internal command prompt Rd/rmdir?

A

Delete a directory

34
Q

What is the internal command prompt Rem?

A

Comment out a line.

35
Q

What is the internal command prompt Set?

A

Set a variable

36
Q

What is the internal command prompt Start?

A

Launch a new instance

37
Q

What is the internal command prompt Time?

A

Display the time

38
Q

What is the internal command prompt Title?

A

Change the window title

39
Q

What is the internal command prompt Type?

A

Display the contents of a file

40
Q

How do you get help from PowerShell?

A

Type Get-Help

41
Q

What does /Y and /V mean in command prompt?

A

/Y and /V are switches. /Y forces overwriting if the destination file already exists.
/V verifies that the file copied correctly.

42
Q

How do you control the behaviour of a command?

A

You use switches.

43
Q

What is PowerShell ISE?

A

It is an integrated scripting environment which gives you more help and assistance when typing commands.

44
Q

How do you start scripting in PowerShell?

A

PS U:\v1

45
Q

How is scripting structured in PowerShell?

A

It is action followed by verb. E.g. Get-command or Get-Help

46
Q

What are cmdlets?

A

They are compiled programs that do something just like external commands in the regular command prompt.

47
Q

What is Batch Scripting, and what are the files saved as?

A

It is a type of script for running batch files. This is different from BASH which is like PowerShell for IOS. It comes with the command line, it is a simple language that allows you to create simple completion of routine tasks. The files are saved as .BAT and can be written in notepad.