Command Line Basics Flashcards

1
Q

What is a CLI?

A

Command Line Interface

Process commands to a computer program in the form of lines of texts

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

What is a GUI?

A

Graphical User Interface

This is for the end user and not the developer

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

What is the man command?

A

List directory contents

Useful to understand what you can do with each command

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

What is the cat command?

A

Concatenate files and print on the standard output

cat -n number all output lines

Useful to merge and view file content

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

What is the ls command?

A
  • a do not ignore entries starting with .
  • F append indicator (one of */=>@|) to entries

Useful to navigate through files and folders

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

What is the pwd command?

A
  • L use PWD from environment, even if it contains symlinks
  • P avoid all symlinks (if no option is specified, -P is assumed)

Useful to print contents of current directory

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

What is the echo command?

A

Display a line of text

Useful to add strings to files

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

What is the touch command?

A

Change file timestamps

Useful to see when modifications were made on a file

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

What is the mkdir command?

A

-p no error if existing, make parent directories as needed

Make directories

Useful for when you need to create a folder to contain new files or folders

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

What is the mv command?

A

Move (rename) files

Useful when renaming files or folder

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

What is the rm command?

A

Remove files or directories

  • r remove directories and their contents recursively
  • f ignore nonexistent files and arguments, never prompt

Useful for when you need to remove a file or directory you no longer need to use

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

What is the cp command?

A

Copy files and directories

-r copy directories recursively

Useful for when you need to duplicate a file or folder

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

Laziness, Impatient, and Hubris

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

Laziness

A

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.

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

Impatience

A

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.

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

Hubris

A

The quality that makes you write (and maintain) programs that other people won’t want to say bad things about