Re: find usage

2022-06-27 Thread Matt Graham via PLUG-discuss

On 2022-06-27 14:30, Brian Cluff via PLUG-discuss wrote:

On 6/27/22 11:32, Michael via PLUG-discuss wrote:

So I'm opening the directory I'm searching in a terminal and type:
find Marriage .
but it just gives me a listing of what is below '.' (I guess).
What am I doing wrong?



 find . -name Marriage
 or
 find . | grep Marriage

 The first one will only match fines that are exactly names
"Marriage" while the second one will match any files with "Marriage"
as part of the name.  Both versions in this case are care sensitive.


I basically always do "find . -name \*string\*" when I'm sure there's 
something in or under . that contains the case-sensitive string string.  
-iname is for when case doesn't matter.  Escaping the * prevents the 
shell from expanding the glob, as it would if you had any files 
containing string in . , and that would confuse you and do the wrong 
thing.


find, like many of the old tools, was not designed for casual users.  
If you have anacron or leave the computer on all the time, and the file 
you're looking for has been on the system for >= 24 hours, "locate -i 
\*string\*" will find all the files matching (case insensitive) string 
no matter where they are, and do so quite quickly.


--
Crow202 Blog: http://crow202.org/wordpress
There is no Darkness in Eternity
But only Light too dim for us to see.
---
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss

RE: find usage

2022-06-27 Thread James Crawford via PLUG-discuss

Try

find -name 'Marriage*'


If you are in the directory it should be in, or 1 above it on your system.


---
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss

Re: find usage

2022-06-27 Thread Brian Cluff via PLUG-discuss

Try:
find . -name Marriage
or
find . | grep Marriage

The first one will only match fines that are exactly names "Marriage" 
while the second one will match any files with "Marriage" as part of the 
name.  Both versions in this case are care sensitive.


See the find man page for for variations on these.  Look for the second 
about expressions.


Brian Cluff

On 6/27/22 11:32, Michael via PLUG-discuss wrote:

I need to find out where I hopefully moved a file.
So I'm opening the directory I'm searching in a terminal and type:

find Marriage .

but it just gives me a listing of what is below '.' (I guess). What am 
I doing wrong?


--
:-)~MIKE~(-:

---
PLUG-discuss mailing list -PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss
---
PLUG-discuss mailing list - PLUG-discuss@lists.phxlinux.org
To subscribe, unsubscribe, or to change your mail settings:
https://lists.phxlinux.org/mailman/listinfo/plug-discuss