Command Lines Flashcards

1
Q

What is a CLI?

A

A command-line interface (CLI) processes commands to a computer program in the form of lines of text.

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

What is a GUI?

A

The graphical user interface (GUI) is a form of user interface that allows users to interact with electronic devices through graphical icons and audio indicator such as primary notation, instead of text-based user interfaces, typed command labels or text navigation.

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

Give at least one use case for ‘man’

A

To pull up the manual for a command and learn what it does.

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

Give at least one use case for ‘cat’

A

To concatenate files and print on the standard output

To view/print the text contents of a file.
To combine the text content of multiple files into a new file.

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

Give at least one use case for ‘ls’

A

To see list of content (files or directories) inside the current working directory

list the contents of a directory and write the results to a new file at a specific directory

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

Give at least one use case for ‘pwd’

A

To see current working directory path

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

Give at least one use case for ‘echo’

A

To display a line of text

To write a string in a new file

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

Give at least one use case for ‘touch’

A

To change a file timestamp

Creates file if doesn’t exist??

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

Give at least one use case for ‘mkdir’

A

To make a new directory

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

Give at least one use case for ‘mv’

A

To rename a file or directory

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

Give at least one use case for ‘rm’

A

To remove a file or directory

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

Give at least one use case for ‘cp’

A

To copy files and directories

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

What are the three virtues of a great programmer?

A
  1. Laziness: The quality that makes you go to great effort to reduce overall energy expenditure. It makes you write labor-saving programs that other people will find useful and document what you wrote so you don’t have to answer so many questions about it.
  2. Impatience: The anger you feel when the computer is being lazy. This makes you write programs that don’t just react to your needs, but actually anticipate them. Or at least pretend to.
  3. Hubris: The quality that makes you write (and maintain) programs that other people won’t want to say bad things about.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly