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
Q

What does the option -la mean?

A

long view attributes

26
Q

old pwd is a env variable that ..

A

stores the last directory you were in.

27
Q

What is the special meaning of the ; meta character?

A

It is used to separate two characters.

28
Q

What are Manuel Pages?

A

A set of pages explaining every command available on the system.

29
Q

How do you keyword search on manual pages?

A

man -k ls

30
Q

If you want to search a specifc keyword in a man page

A

foreward slash then search term /<searchterm></searchterm>

31
Q

What is the difference between ls -a and ls–all ?

A

one is shorthand and one is longhand

32
Q

What are the advantages of using shorthand options?

A

Short hand allows for multiple options to be chained together and are quicker to type out.

33
Q

What are info pages?

A

more detailed than man pages; divided into different nodes or pages and works like a web browser

34
Q

How to do you navigate the info pages?

A

p- previous and n -next and q- back to command line.