Command Lines Flashcards
What is a CLI?
A command-line interface (CLI) processes commands to a computer program in the form of lines of text.
What is a GUI?
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.
Give at least one use case for ‘man’
To pull up the manual for a command and learn what it does.
Give at least one use case for ‘cat’
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.
Give at least one use case for ‘ls’
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
Give at least one use case for ‘pwd’
To see current working directory path
Give at least one use case for ‘echo’
To display a line of text
To write a string in a new file
Give at least one use case for ‘touch’
To change a file timestamp
Creates file if doesn’t exist??
Give at least one use case for ‘mkdir’
To make a new directory
Give at least one use case for ‘mv’
To rename a file or directory
Give at least one use case for ‘rm’
To remove a file or directory
Give at least one use case for ‘cp’
To copy files and directories
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.