command-line-basics Flashcards
What is a CLI?
Command line interface which is just white text on a black background inside a command line. Lacks a graphical user interface. Just a way to interact with a program via text.
What is a GUI?
A graphical user interface which is a more intuitive user friendly way of interacting with a program compared to a CLI.
What is man?
man outputs manuals for users to read about other commands built into the command line
What is cat?
cat outputs the contents of text files to the command line and can combine text files into new text files. Read and concatenate contents of a file.
What is ls?
ls lists the contents of the current directory or of a specific directory, if given the path
What is pwd?
pwd prints the present working directory to the command line and can create files in the present directory by using > after pwd then the file name
What is echo?
echo prints a string to the command line or if followed by > and a file name, the string will be saved to a file. Reads something back to you.
What is touch?
touch is a way to make files in the current directory, or if given a path with the new filename at the end, in a different directory
What is mkdir?
mkdir is a command that creates a new directory in the current directory or with the -p option it can make multiple directories embedded in each other
What is mv?
mv is a way to rename directories or files
What is rm?
rm is a way to remove files or if directories and all their contents need to be recursively removed use -r and the directory name
What is cp
cp is a way to copy the contents of a file and save it as a new file
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.