4 ms·
just run echo * in your directory. That's the same argument grep will get(instead of the * ) when you pass it * . grep will run through all those files, if any
by noselasd 14y ago
just run echo * in your directory. That's the same argument grep will get(instead of the * ) when you pass it * .
grep will run through all those files, if any, and recurse through all the directories, if any. grep recursing down a directory will process all the files/subdirs in that directory. (which includes . files).
If the shell can't expand the * , grep will receive a literal * and try to open a file/directory named * .
- deleted 14y ago[deleted]
- ralph 14y agoPersonally, I `shopt -s failglob' in my .bashrc so any glob that fails to expand is treated as an error by the shell and the command never gets started. I then quote all special globbing characters that I intend to pass to the command as it avoids the sometimes hard to spot errors where a glob expanded unintentionally and the command didn't see the wildcards. Relying on non-matching globbing to reach the command will bite one day.