Command Line Interface/General Info (I) Flashcards

1
Q

What are two ways to control/command a computer?

A

1-GUI (mouse/click/tap/icons)

2-the Command Line Interface

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the main purpose of the command line?

A

To manipulate a computer’s files, directories and programs (move, rename, execute, copy, etc.)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the most common OS for servers?

A

Linux (Mac OS and Unix are similar to it)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the prompt icons for the Bash shell and the Zsh shell?

A

Bash = $

Zsh = %

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

When you are logged in as the admin user (“root”), what is the prompt icon?

This same icon is also used for what?

A

#

Comments

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the main reason to learn how to use the command line?

A

To do system admin tasks such as installing software, compiling/running code, debugging server issues, managing system logs, and restarting servers

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is “rubber duck debugging?”

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

An interface allows you to control a computer. What are the two main parts of an interface?

A

1-a display of info about what the computer is doing

2-a way to tell the computer what to do

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Here is a prompt:

scottjones@Scotts-Air ~ %

Identify each part of the prompt:

scottjones.  =  ?
Scotts-Air   = ?
~  = ?
A

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)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the four items that make up the CLI display?

1-the p______
2-the c______
3-the i______
4-the o_______

A

1-the prompt
2-the cursor
3-the input
4-the output

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

True or false?

A command can be a path to a file.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What are arguments/strings?

A

Pieces of info passed to a command.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Are arguments always need for a commands?

A

No.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is a flag? Where are they placed after a command?

A

A special type of argument. They are usually placed before the other arguments.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What do flags look like? (there are two types)

A

abbreviated flags/one dash:
-s, -z, c, etc.
(These can be combined: -c, -s, -z = -csz )

full-word flags/two dashes:
- -format, etc.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In the command line, what is the only context to tell you where are?

A

the file system

17
Q

True or false?

In the file system, directories are files.

A

True

There is the phrase “non-directory files” to distinguish the files inside a directory

18
Q

What do the following symbols mean?

/

. ( or ./ )

.. ( or ../ )

../.. ( or ../../ )

~

*

A

/ = 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.
19
Q

What is the difference between these:

/home/job

home/job

A
  • 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”
20
Q

What is an executable?

A

A special type of file that can be used as a command

Examples: echo, touch

21
Q

True or false?

A command is a file.

A

True

22
Q

True or false?

All files are commands.

A

False

23
Q

Do all executables require you to type out their paths?

A

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”

24
Q

What character do hidden files start with?

A

.

hidden files are also called “dot files”

.bashrc
.cache
etc.

25
Q

What does this mean?

jobs/

A

“jobs” is your current directory