LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-08-2013, 11:06 PM   #1
AndrewNZ
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Rep: Reputation: Disabled
Find Vs Locate


Hi

How can I refine this search so it works correctly? I wan to be able to find or locate just .iso not files with iso them. The drive below is mounted

find /media/andrew/Windows\ 7/ | grep '.iso'
/media/andrew/Windows 7/ProgramData/AVG2012/log/advisorlog.cfg
/media/andrew/Windows 7/ProgramData/AVG2012/log/avgadvisor.log
/media/andrew/Windows 7/ProgramData/AVG2012/log/avgadvisor.log.1
/media/andrew/Windows 7/ProgramData/AVG2012/log/avgadvisor.log.2
/media/andrew/Windows 7/ProgramData/AVG2012/log/avgadvisor.log.3
/media/andrew/Windows 7/ProgramData/AVG2012/log/avgadvisor.log.lock
/media/andrew/Windows 7/ProgramData/HP/LGT/Data/Models/Images/generic/usb_ethernet_comparison.png
/media/andrew/Windows 7/ProgramData/MFAData/SelfUpd/avgadvisorx.dll
/media/andrew/Windows 7/strawberry/c/include/c++/3.4.5/ciso646
/media/andrew/Windows 7/strawberry/c/lib/gcc/mingw32/3.4.5/include/iso646.h
/media/andrew/Windows 7/strawberry/c/lib/gcc/mingw32/3.4.5/install-tools/include/iso646.h
/media/andrew/Windows 7/strawberry/perl/vendor/lib/DBIx/Simple/Comparison.pod
/media/andrew/Windows 7/strawberry/perl/vendor/lib/XML/Parser/Encodings/iso-8859-2.enc
/media/andrew/Windows 7/strawberry/perl/vendor/lib/XML/Parser/Encodings/iso-8859-3.enc
/media/andrew/Windows 7/strawberry/perl/vendor/lib/XML/Parser/Encodings/iso-8859-4.enc
/media/andrew/Windows 7/strawberry/perl/vendor/lib/XML/Parser/Encodings/iso-8859-5.enc
/media/andrew/Windows 7/strawberry/perl/vendor/lib/XML/Parser/Encodings/iso-8859-7.enc
/media/andrew/Windows 7/strawberry/perl/vendor/lib/XML/Parser/Encodings/iso-8859-8.enc
/media/andrew/Windows 7/strawberry/perl/vendor/lib/XML/Parser/Encodings/iso-8859-9.enc
/media/andrew/Windows 7/useros-extreme-9.04-20090707-0018-i386.iso
/media/andrew/Windows 7/Virtual Machines/#isos
/media/andrew/Windows 7/Virtual Machines/#isos/bodhi-2.0.0-32.iso
/media/andrew/Windows 7/Virtual Machines/#isos/dammsmall.iso
/media/andrew/Windows 7/Virtual Machines/#isos/Joli-OS-1.2.iso

Locate just gives me:
/home/andrew/Downloads/CentOS-6.4-x86_64-LiveDVD.iso
/usr/lib/memtest86+/memtest86+.iso
which is where my linux is installed
 
Old 11-09-2013, 01:26 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,040

Rep: Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914
First things is to better define (to yourself) what you are looking for (hint: ... filenames ending in .iso)

Then look at the manpages for all those commands - they all take regex; including find, so the pipe to grep is unnecessary.
Locate only works against the updatedb, so a recent mount is unlikely to be there - especially /media, which is likely in the prune list and hence ignored.
 
1 members found this post helpful.
Old 11-09-2013, 02:23 AM   #3
AndrewNZ
LQ Newbie
 
Registered: Nov 2013
Posts: 16

Original Poster
Rep: Reputation: Disabled
Cool , thanks for the info , I figured it out:
find /media/andrew/Windows\ 7/Virtual\ Machines/ . -name "*.iso"
 
Old 11-09-2013, 02:50 AM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,040

Rep: Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914Reputation: 1914
Looks much better - glad you like it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
locate and find thirstonlinux Linux - Newbie 8 03-24-2013 01:55 AM
[SOLVED] How to use find command to locate files linuxandtsm Linux - Newbie 4 03-30-2012 11:00 AM
'locate' utility can't find db imputerate Linux - Newbie 9 05-26-2008 06:52 AM
LXer: Locate, Find, and Whereis LXer Syndicated Linux News 0 03-28-2006 04:06 PM
cannot find a kernel, please locate one bobotoes Linux - Newbie 2 10-07-2004 07:15 PM


All times are GMT -5. The time now is 03:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration