CLI Flashcards
What is a CLI?
Command-line interface
An interface where users interact with a device via lines of text
What is a GUI?
Graphic User Interface
An interface for users to interact with the technology/computer, in a more simplified manner
CLI man
Manual page (man commend: opens a manual for that specific command)
If I’m unsure what a specific command does, I can look at the manual of the command
Exp: man cat
CLI cat
Displays the text of a file or concatenates the text, dispensing on the command.
This command can be used to take the text content of two or more files, and saved the text together, in a new file
Exp: cat laziness.txt impatience.txt hubris.txt > three-virtues.txt
CLI ls
You can view all the items inside a directory. If no pathway if given, it shows the content of the current directory
CLI pwd
Prints the current directory you are in. along with the entire pathway.
You can use this to find yourself in your code and mark where you have been
CLI echo
You can use this to print text or save text to a new document.
Exp: echo ‘Hello, World!’ > hello.txt
CLI touch
A command used to create or update timestamps of the last edited
It can be used to create documents as well if it doesn’t exist
CLI mkdir
Creates a directory, if the name of the directory is not already in use, in the specified location
CLI mv
Moved something to another directory
You can use this to rename a directory, if the first destination directory does not exist
Exp: put pokemon into pokemon: mv pokiemans/ pokemon/
CLI rm
Removed a document PERMENANTLY, but not a directory
rm -r will remove a directory
CLI cp
Copies a document and allows you to give it a name
Exp: cp and-then.txt copy-and-then.txt
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.