Question: Why should you always enclose your `grep` search pattern in single quotes? (e.g. `grep -v '?*' file` as opposed to `grep -v ?* file`) Some
Why should you always enclose your `grep` search pattern in single quotes? (e.g. `grep -v '\?*' file` as opposed to `grep -v \?* file`)
| Some shell metacharacters are also regular expression characters, so `grep` could get confused when interpreting the command string. Quoting them makes `grep` ignore them and pass the literal characters to `bash`. | |||||||||||||||||||||||||||||
| They are required by `bash`. | |||||||||||||||||||||||||||||
| Some regular expression characters are also shell metacharacters and `bash` could get confused when interpreting the command string. Quoting them makes `bash` ignore them and pass the literal characters to `grep` | |||||||||||||||||||||||||||||
| They are required by `grep`.
2 ) What does the command `cp file.txt mydir/` do?
3) When you see the command `rm -rf
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
