Find question ? How to use wild cards with arguments ?
Hi,
There exist ~/docs/office/report.txt why does following command fails to get it. ~>find ./ -name report* where as if i give the full name report.txt it works ! Any ideas Why ? Thanks, |
Hi,
on my system it works Code:
markus@samsung:~$ find ./ -name report* btw: you should try "report*" instead. Markus |
Thanks for the quick response using "report*" worked !
I am noob and have few more questions. why "" works ? I am using tcsh how do i find the version of it ? |
Well, I'm using Bash, but I also (sometimes) had issues when using wildcard without "", I don't know why.
If you want to know the version of tcsh use the command Code:
tcsh --version Markus |
%> man find
SYNOPSIS find [-H] [-L] [-P] [-D debugopts] [-Olevel] [path...] [expression] Could it be that last option is expression and "" might be required to evaluate input as string ? Thanks, |
No, I don't think so. The word expression in the find manpage is used with several meanings, don't be confused. I would recommend that you read the manpage for find and afterwards read here http://rute.2038bug.com/node7.html.g...00000000000000 and here http://content.hccfl.edu/pollock/unix/findcmd.htm
Markus |
Quote:
Code:
find ./ -name reporters Now if someone tries your command line when there is not any matching file in the current directory, then the argument gets passed unaltered and find does what was expected. Incidentally, if the pattern happens to match more and one name in the current directory, then all of those names will be included in the find command, and the result is the rather confusing error message, "find: paths must precede expression: ...". |
Thanks folks. Very helpful :)
|
All times are GMT -5. The time now is 12:53 PM. |