Command Line Interface/General Info (I) Flashcards
What are two ways to control/command a computer?
1-GUI (mouse/click/tap/icons)
2-the Command Line Interface
What is the main purpose of the command line?
To manipulate a computer’s files, directories and programs (move, rename, execute, copy, etc.)
What is the most common OS for servers?
Linux (Mac OS and Unix are similar to it)
What are the prompt icons for the Bash shell and the Zsh shell?
Bash = $
Zsh = %
When you are logged in as the admin user (“root”), what is the prompt icon?
This same icon is also used for what?
#
Comments
What is the main reason to learn how to use the command line?
To do system admin tasks such as installing software, compiling/running code, debugging server issues, managing system logs, and restarting servers
What is “rubber duck debugging?”
When you have coding errors, it is the technique of explaining your code aloud line-by-line to a rubber duck, with the idea that doing so will allow you to hopefully come across a solution.
An interface allows you to control a computer. What are the two main parts of an interface?
1-a display of info about what the computer is doing
2-a way to tell the computer what to do
Here is a prompt:
scottjones@Scotts-Air ~ %
Identify each part of the prompt:
scottjones. = ? Scotts-Air = ? ~ = ?
scottjones = the user/the person who is logged into the command line interface
Scotts-Air = the host/the name of the computer
~ = this space shows your current directory (in this example, it’s the home directory)
What are the four items that make up the CLI display?
1-the p______
2-the c______
3-the i______
4-the o_______
1-the prompt
2-the cursor
3-the input
4-the output
True or false?
A command can be a path to a file.
True
What are arguments/strings?
Pieces of info passed to a command.
Are arguments always need for a commands?
No.
What is a flag? Where are they placed after a command?
A special type of argument. They are usually placed before the other arguments.
What do flags look like? (there are two types)
abbreviated flags/one dash:
-s, -z, c, etc.
(These can be combined: -c, -s, -z = -csz )
full-word flags/two dashes:
- -format, etc.
In the command line, what is the only context to tell you where are?
the file system
True or false?
In the file system, directories are files.
True
There is the phrase “non-directory files” to distinguish the files inside a directory
What do the following symbols mean?
/
. ( or ./ )
.. ( or ../ )
../.. ( or ../../ )
~
*
/ = the root directory OR a directory separator
. = current directory/same level
.. = navigate up a level to the parent directory
../.. = navigate up two levels to the grandparent directory
~ = the home directory
- = “splat operator”/it represents any characters you give it. For example, find all files ending in “or”, etc.
What is the difference between these:
/home/job
home/job
- this path starts at the root directory, and ends at “job,” which is a file or sub-directory inside of the directory “home”
- “home” is your current directory, and “job” is a file or sub-directory inside “home”
What is an executable?
A special type of file that can be used as a command
Examples: echo, touch
True or false?
A command is a file.
True
True or false?
All files are commands.
False
Do all executables require you to type out their paths?
No. The common/installed ones don’t require it. Some common ones are “touch” and “echo.” You could add the paths if you wanted to, but it’s not necessary b/c the command line knows where to look to find them
YOU COULD TYPE:
echo “hello”
OR:
/bin/echo “hello”
What character do hidden files start with?
.
hidden files are also called “dot files”
.bashrc
.cache
etc.
What does this mean?
jobs/
“jobs” is your current directory