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?

a.

renames file.txt to mydir/

b.

creates a copy of file.txt inside the mydir directory

c.

creates a copy of mydir called file.txt

d.

moves file.txt into the mydir directory

3)

When you see the command `rm -rf `, what thought should go through your head?

Shouldn't that be `rm -rf /`... or was it `rm -rf *`?

"12:50, press return"

"Danger, Will Robinson!"

Good thing I'm logged in as root!

I read it on the Internet, so it must be right.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!