Command Line Flashcards
1
Q
What is a CLI?
A
Command-line interface receive commands from a user in the form of lines of text.
2
Q
What is a GUI?
A
Graphical user interface is which a user interacts with electronic devices (smartphones) through icons, pointers, navigation elements, buttons, instead of text.
ex: Microsoft Windows, MacOs
3
Q
Give at least one use case for each of the commands listed in this exercise.
- man
- cat
- ls
- pwd
- echo
- touch
- mkdir
- mv
- rm
- cp
A
- man shows the manual
- cat concatenates files and prints on the standard output or redirects files into a new file.
- ls lists directory contents / list information about the files
- pwd Print the full filename of the current working directory
- echo displays a line of text
- touch Update the access and modification times of each FILE to the current time.
- mkdir makes directories
- mv change directory names
- rm remove files or directories
- cp copies files or directories
4
Q
Give at least one use case for each of the commands listed in this exercise.
- man
- cat
- ls
- pwd
- echo
- touch
- mkdir
- mv
- rm
- cp
A
- man shows manual of a given command.
- cat concatenate files and print results
- ls lists content of directories and files
- pwd prints the name of current working directory, answers question which file am i on
- echo displays a line of text or string
- touch update the access and modifications of each file, also creates files.
- mkdir makes directories if they dont already exist
- mv rename files if they have a typo
- rm deletes files or directories be careful it instantly deletes your file with no going back.
- cp copies files or directories
5
Q
What are the three virtues of a great programmer?
A
- 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.