20250419 Flashcards

(7 cards)

1
Q

What is the difference between single and double quotes for strings on Linux?

A
  • Single quotes treat their contents literally, while double quotes permit varibles and other shell contents to be evaluated like the variable $HOME in a string
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What to do if a character has a special meaning to the shell

A

precede the character with the \ character
like echo a\* instead of echo a*
`echo “I live in a $HOME”

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

How to display the last 4 previous commands in the shell?

A

history 4

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

How to clear the history?

A

history -c

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

What does !! represent?

A

your previous command

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

What does represent the last argument from the previous command, and what is it used for?

A

!$

great for checking that files are present before running a destructive command
- ls z*
- rm !$

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

What does !* represent?

A

Represents all arguments from the previous command
- ls check_imports.sh check_ql.sh
- wc !*

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