When I do something like this:
grep "hello" /home/paul/*
But when I do something like this:
grep "hello" "/home/paul/*"
grep display the error:
grep: /home/paul/*: No such file or sirectory
Why is that?
From the bash reference manual:
Enclosing characters in double quotes (‘"’) preserves the literal value of all characters within the quotes, with the exception of ‘$’, ‘`’, ‘\’, and, when history expansion is enabled, ‘!’.
So you must remove the special character
* from your quoted string in order for it to be treated as a wildcard.
grep "hello" "/home/paul/"*