Command Line Basics Flashcards
What is a CLI?
Command Line Interface
Process commands to a computer program in the form of lines of texts
What is a GUI?
Graphical User Interface
This is for the end user and not the developer
What is the man command?
List directory contents
Useful to understand what you can do with each command
What is the cat command?
Concatenate files and print on the standard output
cat -n number all output lines
Useful to merge and view file content
What is the ls command?
- a do not ignore entries starting with .
- F append indicator (one of */=>@|) to entries
Useful to navigate through files and folders
What is the pwd command?
- 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
What is the echo command?
Display a line of text
Useful to add strings to files
What is the touch command?
Change file timestamps
Useful to see when modifications were made on a file
What is the mkdir command?
-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
What is the mv command?
Move (rename) files
Useful when renaming files or folder
What is the rm command?
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
What is the cp command?
Copy files and directories
-r copy directories recursively
Useful for when you need to duplicate a file or folder
What are the three virtues of a great programmer?
Laziness, Impatient, and Hubris
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.