I read many questions and answers like this and this one
I know wildcards are expanded by the shell before running a command and they are a feature of the shell.
Also wildcards work with those commands that can accept many arguments.
In find . -name *.rb if we have more than one file in the current directory find will give us an error because find cannot accept multiple arguments and the ways to solve this are:
find . -name "*.rb"
find . -name '*.rb'
find . -name \*.rb
We escape the asterisk and prevent expansion by the shell but wildcards are a feature of the shell; when we escape the asterisk shell does not know about its meaning, and it should find a file named *.rb, so how is the asterisk being expanded in this case?
*is quoted, then the shell won't expand it, and the argument including the glob is passed to the command that can understand the glob - it's the same for any commands that accept regex which should always be quoted... – Zanna Sep 22 '16 at 08:39find– slebetman Sep 22 '16 at 10:26[archive filename single argument] [list of files to extract]") for example. – Random832 Sep 22 '16 at 13:33./test.txt
[shubhanshu01@fedori ~]$find -name ".txt"
./.magic_string.txt
./test.txt what is the difference here – Shubhanshu Vishwakarma Sep 22 '16 at 19:29