two Flashcards

1
Q

comment

A

#

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

How to remove permission from a file

A

ug=

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

what is the symbols for decimal integer and float number

A

%d

%f

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

what is the symbol for a string

A

%s

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

what is printf format

A

printf “char constants %s %f…” $variable

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

What is the use of$ (….)

A

The function of$ (….)is to implement command in it, not like ${…} is used to contain the variable name

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

default shell variable value

A

echo ${variablename=value}

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

The difference between ${variable=value} and ${variable-value}

A

${variable=value} will assign value to variable

${variable-value} won’t assign value to variable

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

assign a default value to a variable

A

${variable:=value}

${variable=value}

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

can we put space character between a assignment operator

A

No, we can’t put space character between = which will result error

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

Is underscore viable in the variable specifier

A

_name

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

can we use echo to print the file name in current directory

A

echo *.fileextension

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

printf format

A

printf “%w.pL” $variable
%w for width
p for decimal digits after decimal point
L for variable type

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

How to quote without translate the $ sign

A

use single quote

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

wildcards in single and double quotes

A

echo “/etc/*.conf” will not translate *

echo ‘/etc/*.conf’ will not translate *

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

command substitution in single and double quote

A

”$()” will be translated

‘$()’ will not be translated

17
Q

How to continue a line in linux

A

using backslash \

18
Q

find format

A

find [PATH} -name pattern

19
Q

export a variable to new process

A

export variable=value

20
Q

unset shell and environment varibales

A

unset variable

21
Q

read command syntax

A

read -p “message” variable1 variable2…..