Misc Flashcards

1
Q

How to remove everything from the current text insertion point to the end of the line

A

Control K

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

How to remove everything from the current text insertion point to the beginning of the line

A

Control U

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

Options for help

A

–help, -h, info, man

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

How to have grep ignore case …

A

run it with the -i option

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

How to have grep search directories

A

use the -r (recursive) option
grep -r will search through all files in a directory …
and in all subdirectories

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

Compare differences between two files

A

diff -y

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

What makes a file hidden

A

Prefacing it with .

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

Chmod number values for read write and execute:

A

4 if you want to give read permission
2 if you want to give write permission
1 if you want to give execute permission

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

How to kill a job using job number

A

precede a job number with a percent sign, %

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

How to exclude numbers from metacharacter bracket range

A

insert an exclamation mark, ! , or a caret, ^ immediately after the opening bracket the shell will match anysingle character that is NOT included within the brackets

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

How to comment in a shell script

A

, except with #! the hashbang line

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

Value of HOME

A

The absolute pathname of your home directory

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

Value of PATH

A

The list of directories the shell will search when looking for the executable file associated with a command you entered at the command line

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

Value of SHELL

A

The absolute pathname of your default shell

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

Value of PS1

A

Your command line prompt - what you see after entering each command

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

Value of PS2

A

The secondary prompt - what you see if you continue a command to a second line

17
Q

How to run a previous command with an event number

A

you can run it again by using an exclamation mark, ! …
followed by the event number
$ !517

18
Q

How to use command substitution

A

$(COMMAND)

Where COMMAND is any valid Unix command

19
Q

Test if two numbers are equal

A

-eq

20
Q

Test if two numbers aren’t equal

A

-ne

21
Q

Test if the first number is greater than or equal to the second

A

-ge

22
Q

Test if the first number is greater than the second

A

-gt

23
Q

Test if the first number is less than or equal to the second

A

-le

24
Q

Test if the first number is less than the second

A

-lt

25
Q

Test if two strings are the same

A

=

26
Q

Test if two strings are different

A

!=

27
Q

Test if both expressions are true

A

-a

28
Q

Test if either expression is true

A

-o

29
Q

Test if one number is greater than another within a script

A

test $number1 -gt $number2
or
[ $number1 -gt $number2 ]

30
Q

Read a value from a user’s keyboard

A

read value