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
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”
3
Q
How to display the last 4 previous commands in the shell?
A
history 4
4
Q
How to clear the history?
A
history -c
5
Q
What does !!
represent?
A
your previous command
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 !$
7
Q
What does !*
represent?
A
Represents all arguments from the previous command
- ls check_imports.sh check_ql.sh
- wc !*