command-line-basics Flashcards
What is a CLI?
command line interface: text-based way to talk to a program
What is a GUI?
graphical user interface: web apps etc
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
man: access the online reference manuals
cat: read/concat files
ls: list contents of a directory
pwd: print full file name of current/working directory, tells you “where am i right now”
echo: display a line of text that was typed,
use case: when you want to assign text to a file
touch: updating timestamps/creating new files
mkdir: make directories
mv: moving a file, which is done by renaming the file
rm: removing files
-r option can remove directories and their files
cp: make copies of files
What are the three virtues of a great programmer?
- 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.
- 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.
- Hubris: The quality that makes you write (and maintain) programs that other people won’t want to say bad things about.