Results 1 to 6 of 6
  1. #1


    Member Since
    May 04, 2009
    Posts
    3
    Finding a file in Terminal
    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!

  2. #2

    Zoolook's Avatar
    Member Since
    Sep 24, 2006
    Location
    Brooklyn, New York
    Posts
    2,756
    Specs:
    15" MacBook Pro, i7 2.66Ghz, 8GB RAM, 512GB SSD; iPad 3, iPhone 5
    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


  3. #3


    Member Since
    May 04, 2009
    Posts
    3
    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!

  4. #4

    Zoolook's Avatar
    Member Since
    Sep 24, 2006
    Location
    Brooklyn, New York
    Posts
    2,756
    Specs:
    15" MacBook Pro, i7 2.66Ghz, 8GB RAM, 512GB SSD; iPad 3, iPhone 5
    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


  5. #5

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,736
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    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

  6. #6

    xstep's Avatar
    Member Since
    Jun 25, 2005
    Location
    On the road
    Posts
    3,231
    Specs:
    2011 MBP, i7, 16GB RAM, MBP 2.16Ghz Core Duo, 2GB ram, Dual 867Mhz MDD, 1.75GB ram, ATI 9800 Pro vid
    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Finding HD directories in Terminal
    By Rhetro in forum Apple Notebooks
    Replies: 3
    Last Post: 07-24-2012, 03:56 PM
  2. Creating and Finding a Python file
    By Lbatson21 in forum OS X - Development and Darwin
    Replies: 5
    Last Post: 07-27-2011, 08:15 PM
  3. Finding ANY file on OS X
    By UncleRic in forum OS X - Development and Darwin
    Replies: 5
    Last Post: 03-27-2009, 04:59 PM
  4. Finding and updating environmental variables in Terminal
    By woodcreeper in forum OS X - Operating System
    Replies: 3
    Last Post: 07-17-2008, 07:14 PM
  5. Finding a file (application)
    By WhitE_RabbiT in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 08-05-2004, 02:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •