Command Line Flashcards
What is a CLI?
Command-line interface: a text-based user interface (UI) used to run programs, manage computer files and interact with the computer.
What is a GUI?
Graphical user interface: a form of UI that allows users to interact with electronic devices through graphical icons and audio indicators such as primary notation, instead of text-based UIs, types command labels or text navigation. Was introduced in reaction to the perceived steep learning curve of the CLIs.
man
man - an interface to the system reference manuals
cat
cat - concatenate files and print on the standard output
ls
ls - list directory content
- a –all [do not ignore entries starting with .]
- F –classify [append indicator (one of */=>@|) to entries]
pwd
pwd - print name of current/working directory
echo
echo - display a line of text
touch
touch - change file timestamps
mkdir
mkdir - make directories
-p –parents [make parent directories as needed]
mv
mv - move (rename) files
rm
rm - remove files or directories
- r -R –recursive [remove directories and their contents recursively]
- f –force [ignore nonexistent files and arguments, never prompt]
cp
cp - copy files and directories
-r -R –recursive [copy directories recursively]
history
history - GNU History Library
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.