Command Line Flashcards

1
Q

What is a CLI?

A

A command-line interpreter or command-line processor uses a command-line interface (CLI) to receive commands from a user 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

Graphical user interface, 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 UIs, 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 each of the commands listed in this exercise.
man
cat
ls
pwd
echo
touch
mkdir
mv
rm
cp
A
  • man: Interface to the on-line reference manuals. You can see the manual for every command
  • cat: to concatonate files. Concatenate the content together and print the results.
  • ls: List the contents of a directory
    pwd: Print the name of the current/working directory. Where am I right now? <== answers this questions
  • echo: displays a line of text. console.log for the terminal
  • touch: updates the modified timestamps to ‘now’. In the finder, there is a ‘date modified’. This is what touch is changing. Also can be used to create a file that doesn’t exist.
  • mkdir: makes directories
  • mv: move and rename files
  • rm: remove files or directories. No going back once deleted
  • cp: copy files and directories
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
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