command-line-basics Flashcards

1
Q

What is a CLI?

A

Command line interface which is just white text on a black background inside a command line. Lacks a graphical user interface. Just a way to interact with a program via text.

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

What is a GUI?

A

A graphical user interface which is a more intuitive user friendly way of interacting with a program compared to a CLI.

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

What is man?

A

man outputs manuals for users to read about other commands built into the command line

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

What is cat?

A

cat outputs the contents of text files to the command line and can combine text files into new text files. Read and concatenate contents of a file.

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

What is ls?

A

ls lists the contents of the current directory or of a specific directory, if given the path

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

What is pwd?

A

pwd prints the present working directory to the command line and can create files in the present directory by using > after pwd then the file name

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

What is echo?

A

echo prints a string to the command line or if followed by > and a file name, the string will be saved to a file. Reads something back to you.

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

What is touch?

A

touch is a way to make files in the current directory, or if given a path with the new filename at the end, in a different directory

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

What is mkdir?

A

mkdir is a command that creates a new directory in the current directory or with the -p option it can make multiple directories embedded in each other

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

What is mv?

A

mv is a way to rename directories or files

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

What is rm?

A

rm is a way to remove files or if directories and all their contents need to be recursively removed use -r and the directory name

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

What is cp

A

cp is a way to copy the contents of a file and save it as a new file

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