Section 5: Command Line Flashcards

1
Q

What is the general order of command syntax?

A

first word is the command and the rest are the parameters.

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

What are the two types of parameters?

A

Start with a dash ( - a, - c or -ac) called options know as switches and arguments that have no leading dashes usually the name of the file/s the command will process.

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

what the two types of options?

A

short dash options ex: -a ,-c or -ac (they can be put together) or long dash options which use two dashes and can not be put together –

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

What is the general command structure?

A

Command ( what you want it to do) > Option ( How to do it) > Argument ( What to do with it)

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

What is the benefit of computing?

A

To simplify repetitive and huge tasks.

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

Shell allows us automate tasks by using shell scripts

A

true

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

What is a shell script?

A

A file containing a series of commands.

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

What is a variable?

A

Areas of memory that can be used to store information and are referred to by a name.

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

The benefits of a variable are?

A

Machine code more readable to users, a placeholder for unknown values, can be a value or a command, user doesn’t know value before they execute the program and it will be resolved at execution time.

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

Should you put spaces in variables?

A

no

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

What are the rules for naming variables?

A

Must start with a letter, a name not contain embedded spaces, no punctuation marks allowed.

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

How to you print all the environment variables?

A

printenv

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

What does an all uppercase variable indicate?

A

It is an environment variable.

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

What are meta characters?

A

characters that are treated differently by the command line ( or are special)

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

What does the shell use to identify the arguments for a command?

A

blanks/space are interpreted by the shell as how to separate arguments. More than one blank is still treated as one blank.

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

What are some examples of meta characters ?

A

dollar sign $, star *, semi-colon ; , greater than >, question mark ?, ampersand & and the pipe |

17
Q

What is Quoting?

A

The act of protecting shell meta-characters from being treated specially by the shell.

18
Q

What does Quoting do?

A

It prevents the shell from acting on and expanding the meta-characters.

19
Q

What is the syntax for quoting?

A

” “ , ‘ ‘ , or \

20
Q

What does ~ on the command prompt mean?

A

Home Directory

21
Q

What does cd stand for?

A

Change Directory

22
Q

What does pwd mean?

A

Present working directory

23
Q

What does touch mean?

A

It creates an empty file with whatever you put in it.

24
Q

What does ls -la do?

A

List but with additional details such as permissions, who owns it, file size and when it was created.

25
What does the option -la mean?
long view attributes
26
old pwd is a env variable that ..
stores the last directory you were in.
27
What is the special meaning of the ; meta character?
It is used to separate two characters.
28
What are Manuel Pages?
A set of pages explaining every command available on the system.
29
How do you keyword search on manual pages?
man -k ls
30
If you want to search a specifc keyword in a man page
foreward slash then search term /
31
What is the difference between ls -a and ls--all ?
one is shorthand and one is longhand
32
What are the advantages of using shorthand options?
Short hand allows for multiple options to be chained together and are quicker to type out.
33
What are info pages?
more detailed than man pages; divided into different nodes or pages and works like a web browser
34
How to do you navigate the info pages?
p- previous and n -next and q- back to command line.