Mastering the CLI Flashcards

1
Q

What are the advantages of a CLI when compared to a GUI?

A
  • Faster
  • Uses less system resources
  • Is more consistent and predictable update-to-update than a GUI
  • Flexible and Powerful
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the Anatomy of a CLI line?

A
  • Prompt: Shows current directory or Branch Name
  • Command: Instructions
  • Option/Flag: Indicated by a -; optional and they customize the output/operation of the command
  • Argument: A data set that the command works on/with; some commands support multiple arguments, seperated by a space
  • Cursor: Shows current position of user interaction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does the command echo do?

A

prints argument to the screen

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

What does the shortcut CTLR+c do?

A

Kills any command that is currently running, and starts a new line

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

What does the shortcut CTLR+a do?

A

Moves cursor to the beginning of the line

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

What does the shortcut CTLR+e do?

A

Moves cursor to the end of the line

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

What does the shortcut CTLR+u do?

A

Clears the current line

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

What does the shortcut CTLR+l do?

A

Clears the terminal window (but does not clear history)

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

What does the shortcut Up Arrow do?

A

Copies the previous command to the line

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

What does the shortcut Down Arrow do?

A

Copies the next command to the line

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

What does the command ls do?

A

Lists the contents of the working directory

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

What does the command ls -a do?

A

Lists the contents of the working directory w/ hidden files

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

What is the argument in ls ?

A

A path

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

What does the command man do?

A

Opens a ‘manual’ for the argument, which is a command

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

What directory (in a UNIX filesystem) contains basic commands and programs needed to achieve minimal working environment?

A

/bin (/sbin)

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

What does the command cd do?

A

changes the directory to the path given in the argument

17
Q

What does the command cd do (Specifically with no argument)?

A

changes the directory to the home directory

18
Q

What does the command mkdir do?

A

Makes a directory with the directory name given as arguments, can make multiple directories in one call

19
Q

What does the command touch do?

A

Makes a file with the file name given as arguments, can make multiple files in one call

20
Q

What does the command mv do?

A

Moves a file (the first argument as a filepath) into a given directory (the second argument)

21
Q

What is a shell?

A

A command-line interpreter, responsible for sending commands to the OS/Kernel, and responses to those commands back to the CLI