* question on "find"
@ 2004-04-18 23:47 Tony Gogoi
2004-04-19 1:17 ` Stephen Samuel
2004-04-19 11:15 ` Glynn Clements
0 siblings, 2 replies; 3+ messages in thread
From: Tony Gogoi @ 2004-04-18 23:47 UTC (permalink / raw)
To: linux-admin
I have another question.
"find ./*" displays recursively all files in this and its sub-directories.
However for some files that were ftp'ed from a Windows system eg.
something like in the one of the directories
"(Doc - PDF) My Document.pdf"
would cause "find *" to display "invalid predicate...." .
How can I overcome this problem ?
Thanks.
Thanks Mike and Raju for ur earlier responses.
Tony Gogoi
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: question on "find"
2004-04-18 23:47 question on "find" Tony Gogoi
@ 2004-04-19 1:17 ` Stephen Samuel
2004-04-19 11:15 ` Glynn Clements
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Samuel @ 2004-04-19 1:17 UTC (permalink / raw)
To: Tony Gogoi, linux-newbie
The easiest would be to just 'find . '
That tells it to search in the current dirctory (and also
find hidden files in the current directory, which "find *" won't)
I don't see why "Doc - PDF" would cause you
problems, but I can see "-pdf doc" causing a problem,
because the leading '-' makes the filename look like a
find search option (and all other filenames after that
are evaluated in that context).
That can be worked around by using './*' instead of '*'
(replace '*' with any globbing pattern)
This would keep the first character of a filename from
ever being a "-"
Tony Gogoi wrote:
> I have another question.
>
> "find ./*" displays recursively all files in this and its sub-directories.
>
> However for some files that were ftp'ed from a Windows system eg.
> something like in the one of the directories
> "(Doc - PDF) My Document.pdf"
> would cause "find *" to display "invalid predicate...." .
> How can I overcome this problem ?
>
> Thanks.
>
> Thanks Mike and Raju for ur earlier responses.
>
>
>
> Tony Gogoi
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Stephen Samuel +1(604)876-0426 samuel@bcgreen.com
http://www.bcgreen.com/~samuel/
Powerful committed communication. Transformation touching
the jewel within each person and bringing it to light.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: question on "find"
2004-04-18 23:47 question on "find" Tony Gogoi
2004-04-19 1:17 ` Stephen Samuel
@ 2004-04-19 11:15 ` Glynn Clements
1 sibling, 0 replies; 3+ messages in thread
From: Glynn Clements @ 2004-04-19 11:15 UTC (permalink / raw)
To: Tony Gogoi; +Cc: linux-admin
Tony Gogoi wrote:
> I have another question.
>
> "find ./*" displays recursively all files in this and its sub-directories.
Not quite. "find ." will do that; "find ./*" is equivalent to running
find with all of the files and directories which don't start with a
dot as arguments.
On Unix, wildcards such as "?" and "*" are expanded by the shell. E.g.
the the current directory contains files named "foo", "bar" and "baz",
then "<command> *" is equivalent to "<command> foo bar baz",
regardless of what <command> actually is.
This is why e.g. "mv *.cxx *.cpp" doesn't work like "ren *.cxx *.cpp"
does under DOS. The command only gets to see the expanded list of
arguments, not the wildcards.
If you want to pass wildcards to a command, you have to use quotes,
e.g.:
find . -type f -name '*.txt'
> However for some files that were ftp'ed from a Windows system eg.
> something like in the one of the directories
> "(Doc - PDF) My Document.pdf"
> would cause "find *" to display "invalid predicate...." .
> How can I overcome this problem ?
Just use "find .".
--
Glynn Clements <glynn.clements@virgin.net>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2004-04-19 11:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-04-18 23:47 question on "find" Tony Gogoi
2004-04-19 1:17 ` Stephen Samuel
2004-04-19 11:15 ` Glynn Clements
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.