New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Finding a file in Terminal


Post Reply New Thread Subscribe

 
Thread Tools
andy89

 
Member Since: May 04, 2009
Posts: 3
andy89 is on a distinguished road

andy89 is offline
I left the country for 7 months and when I came back someone had moved some files around on my computer. I am looking for one folder in-particular but for the life of me can't remember the name of it right now. I have tried using finder but had no luck. I know the .extension that it uses and I was wondering if I can search for a file in Terminal by the extension it uses. Anything helps. Thanks for your time!
QUOTE Thanks
Zoolook

 
Zoolook's Avatar
 
Member Since: Sep 24, 2006
Location: Brooklyn, New York
Posts: 2,751
Zoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud of
Mac Specs: 15" MacBook Pro, i7 2.66Ghz, 8GB RAM, 512GB SSD; iPad 3, iPhone 5

Zoolook is offline
Have you tried using spotlight?

What kind of file is it? If it's a document, you can use spotlight to search for a keyword within the document.

In the land of the blind, the one-eyed man is stoned to death.
- Joan D. Vinge

QUOTE Thanks
andy89

 
Member Since: May 04, 2009
Posts: 3
andy89 is on a distinguished road

andy89 is offline
Probably another thing I should have mentioned is that I used LameSecure to lock the folder. It is just a folder with a bunch of music files that I have created in Logic. I can't find the folder in spotlight because I forget the name and I can't search for the contents because LameSecure hides them from spotlight. They aren't hidden in terminal, however, so if I could just figure out how to search for certain extensions on the complete hard drive in terminal I would be in good shape. Thanks for the response!
QUOTE Thanks
Zoolook

 
Zoolook's Avatar
 
Member Since: Sep 24, 2006
Location: Brooklyn, New York
Posts: 2,751
Zoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud ofZoolook has much to be proud of
Mac Specs: 15" MacBook Pro, i7 2.66Ghz, 8GB RAM, 512GB SSD; iPad 3, iPhone 5

Zoolook is offline
I only know how to use the mdfind command in the terminal, but AFAIK that uses spotlight technology anyway.

You could try it. Type this:

mdfind "kMDItemFSName = [name]"

replace [name] with the actual partial filename or extension you know

If you know the directory roughly, you could try

mdfind -onlyin [name of directory]

In the land of the blind, the one-eyed man is stoned to death.
- Joan D. Vinge

QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,757
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
You can use locate to do the job.

First, update the locate database:
Code:
sudo /usr/libexec/locate.updatedb
Second, use locate to find the files:
Code:
locate *.html
This would search for all html files on your computer. Replace as necessary.

Important Links: Community Guidelines : Use the reputation system if you've been helped.
M-F Blog :: Write for the blog
Writing a Quality Post
QUOTE Thanks
xstep

 
xstep's Avatar
 
Member Since: Jun 25, 2005
Location: On the road
Posts: 3,231
xstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to allxstep is a name known to all
Mac Specs: 2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid

xstep is offline
The find command may be helpful here. Do a 'man find' in the terminal. Near the end are some examples.

To find files with extensions '.mov' from the very top directory down, you would do;
find / -name '*.mov' -print

CameraTime - Time lapse photography for novice and advanced users.

When asking questions, post the version of your software. You'll receive better answers.

Please post your results to the thread as it is good feedback.
QUOTE Thanks

Post Reply New Thread Subscribe


« Applescript - Firefox | Any Cocoa Developers Out There? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
What is up with Quicken 2007 Mac ImBatman OS X - Apps and Games 3 03-30-2012 11:03 AM
Host file modification mastertag OS X - Operating System 4 07-11-2008 03:11 PM
Terminal problems please help CliveO OS X - Operating System 6 03-20-2007 10:04 AM
how to open eml file from terminal? erv2 OS X - Development and Darwin 3 02-17-2006 05:08 PM
Finding disk usage by file type gatorparrots OS X - Development and Darwin 1 12-23-2002 06:34 PM

All times are GMT -4. The time now is 02:37 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?