"find" command not finding [SOLVED]

Forum rules
Before you post please read this

"find" command not finding [SOLVED]

Postby Catchpole on Sun Mar 31, 2013 3:05 am

I don't know if I'm in the right place for this question.
I'll re-post if some one tells me a better place.

I was using the find command to find a missing iso file but it was not picked up.
The first command I used was:
Code: Select all
 ~ $ find / -iname *.iso 2>/dev/null
/home/richard/precise-5.4.2.iso

This found one iso but not the one I was looking for.
So I put an "i" in front of the search term (i*.iso) because I knew it began with "install"
Code: Select all
 ~ $ find / -iname i*.iso 2>/dev/null
/home/richard/dvdiso/install-x86-minimal-20121213.iso
richard@Tower-Case ~ $

Can some one tell me why was it not picked up with the first try?

Thanks in advance for any information.
Last edited by Catchpole on Sun Mar 31, 2013 8:45 am, edited 1 time in total.
Desktop Computer:
Motherboard = Gigabyte GA-H61M-USB3V
CPU = Intel i3-3240 3.4GHz
Graphics card = nvidia GEFORCE 210
Operating system = Linux Mint 13 LTS (32bit)
Memory = 8GB
User avatar
Catchpole
Level 2
Level 2
 
Posts: 91
Joined: Sat Dec 24, 2011 4:15 am
Location: Leeds UK

Linux Mint is funded by ads and donations.
 

Re: "find" command not finding

Postby catweazel on Sun Mar 31, 2013 7:33 am

Code: Select all
man find
[...]
-iname pattern
Like -name, but the match is case insensitive.  For example, the patterns 'fo*' and 'F??' match the file names  'Foo', 'FOO', 'foo', 'fOo', etc.   In these patterns, unlike filename expansion by the shell, an initial '.' can be matched by '*'. That is, find -name *bar will match the file '.foobar'.   Please note that you should quote patterns as a matter  of  course,  otherwisethe shell will expand any wildcard characters in them.
[...]

Fancy that. It's in the manual.

Old Timer (1948 model)

Ha. Spring chicken. I've got 20 years on you, son.
Mint Testing Team & Mint Donor #3606
KDE 4.12.0, custom preemptive kernel 3.12.5,
Intel i7 4770K @ 4.7GHz, 16GB 2666MHz XMP,
4 Samsung 840 PRO 512GB SSDs in RAID0,
6TB HW RAID10, dual 24" Acer X243H,
Gigabyte nVidia GTX 680 Super Overclock
User avatar
catweazel
Level 7
Level 7
 
Posts: 1656
Joined: Fri Oct 12, 2012 9:44 pm

Re: "find" command not finding [SOLVED]

Postby Catchpole on Sun Mar 31, 2013 8:55 am

Hi catweazel,

I'd read the manual a number of times in trying to solve the problem.
However I thought that if its clear to you in the manual then I'd better read it again. (Paying more attention)

Sure enough its there.
I used single quotes around the filemane pattern ( '*.iso' ) and they all popped out.

Thanks for the benefit of your twenty years seniority.

Catchpole.
Desktop Computer:
Motherboard = Gigabyte GA-H61M-USB3V
CPU = Intel i3-3240 3.4GHz
Graphics card = nvidia GEFORCE 210
Operating system = Linux Mint 13 LTS (32bit)
Memory = 8GB
User avatar
Catchpole
Level 2
Level 2
 
Posts: 91
Joined: Sat Dec 24, 2011 4:15 am
Location: Leeds UK

Re: "find" command not finding [SOLVED]

Postby catweazel on Sun Mar 31, 2013 5:54 pm

Cheers, son.
Mint Testing Team & Mint Donor #3606
KDE 4.12.0, custom preemptive kernel 3.12.5,
Intel i7 4770K @ 4.7GHz, 16GB 2666MHz XMP,
4 Samsung 840 PRO 512GB SSDs in RAID0,
6TB HW RAID10, dual 24" Acer X243H,
Gigabyte nVidia GTX 680 Super Overclock
User avatar
catweazel
Level 7
Level 7
 
Posts: 1656
Joined: Fri Oct 12, 2012 9:44 pm


Return to Scripts & Bash

Who is online

Users browsing this forum: No registered users and 1 guest