Show hidden files Mac OS X 10.7 Lion

On July 7, 2011, in Blog, OSX Tips, by Mike Hudson

So, prior to my upgrade to OS X 10.7 all of my OS related hacks where done using third party tools such as Secrets Prefpane. However, I have decided to try and avoid third party apps as much as possible, and actually try and keep my Lion install as slim as possible.

So here’s my first of what will soon be many OS X terminal commands to do what the third party apps do, without the bloat/overhead.

To enable hidden files/folders in finder windows:

  1. Open Finder
  2. Open the Utilities folder
  3. Open a terminal window
  4. Copy and paste the following line in:
    1
    
    defaults write com.apple.Finder AppleShowAllFiles YES
  5. Press return
  6. Now hold ‘alt’ on the keyboard and right click on the Finder icon
  7. Click on Relaunch
You should find you will now be able to see any hidden files or folders. One you are done, perform the steps above however, replace the terminal command in step 4 with:

1
defaults write com.apple.Finder AppleShowAllFiles NO
Tagged with:  
  • Pingback: {Advanced} LaunchPad App Removal – OS X 10.7

  • http://twitter.com/digihead Girts Dumpis

    any ideas how to change folder from hidden to visible permanently? renaming using dot in front not working for user/library for instance….

    • http://www.mikesel.info/ Mike Hudson

      The above code in Terminal should unhide the folder permanently, unless you switch it back off again obviously. 

      Hope that answers your question. 

      Thanks
      Mike

      • http://www.facebook.com/profile.php?id=1080372091 Shaurjya Banerjee

        Hi Mike, I’m sorry to say my terminal returns “No such file or directory” I copied the hidden files out from my iPod (I needed to get music from my iPod onto my computer). The command I entered was-

        chflags nohidden /Users/Shaurjya/Music/iTunes/iTunes Media/Music

        that IS the path that contains the hidden files, but i can’t seem to get Terminal to make them visible permanently. Cos iTunes won’t see it otherwise.

        Thanks for the help.
        Cheers.

        • http://www.mikesel.info/ Mike Hudson

          Hi 

          You may want to wrap the path in ‘ symbols, the error message I got when I tried your terminal command was splitting the path due to the space.

          So try:

          sudo chflags nohidden ‘/Users/Shaurjya/Music/iTunes/iTunes Media/Music’

          Thanks

          • http://www.facebook.com/profile.php?id=1080372091 Shaurjya Banerjee

            Thanks so much for your help mate :D
            Cheers.

          • http://www.facebook.com/profile.php?id=1080372091 Shaurjya Banerjee

            Thanks so much for your help mate :D
            Cheers.

    • Ben Mazin

      The ~/Library folder has a hidden flag. To change the flag of a folder use the chflags command. You type the command + hidden/nohidden + path.

      For example:chflags nohidden ~/Library

      Hope that answers your question

      Ben

    • Ben Mazin

      The ~/Library folder has a hidden flag. To change the flag of a folder use the chflags command. You type the command + hidden/nohidden + path.

      For example:chflags nohidden ~/Library

      Hope that answers your question

      Ben

      • http://www.mikesel.info/ Mike Hudson

        Thanks for your contribution Ben.

      • http://www.mikesel.info/ Mike Hudson

        Thanks for your contribution Ben.

      • http://www.mikesel.info/ Mike Hudson

        Thanks for your contribution Ben.

      • http://pulse.yahoo.com/_WH354UB6WHVXRCHUP3FEXSQJLU Randall

        Why does terminal say no such file or directory, when I enter this:

        chflags nohidden ~/Users/my_name/Library

        • http://www.mikesel.info/ Mike Hudson

          Hello Randall

          Typing in the tild symbol (~) removes the need to type in the rest of the path.

          So at the terminal prompt type: 

          chflags nohidden ~/Library

          Thanks Mike 

          • http://pulse.yahoo.com/_WH354UB6WHVXRCHUP3FEXSQJLU Randall

            Thanks Mike, it worked.  Now I can migrate to a new Mac manually, since I missed the opportunity on the first startup!

          • http://www.mikesel.info/ Mike Hudson

            Glad I could help.. Happy transferring!

    • Ben Mazin

      The ~/Library folder has a hidden flag. To change the flag of a folder use the chflags command. You type the command + hidden/nohidden + path.

      For example:chflags nohidden ~/Library

      Hope that answers your question

      Ben

  • Pingback: Mac OS X Lion — Changing SSHD port | .: A Blog To Be Named Later :.

  • Pingback: Show hidden files Mac OS X 10.7 Lion | Capotefamily

  • http://brajeshwar.com Brajeshwar

    I’d suggest adding a “killall Finder” to Relaunch it automagically!

    • http://www.mikesel.info/ Mike Hudson

      Thanks for your comment and suggestion :o )

  • Pingback: Restore Hidden Files to OS X 10.7 Lion Finder « zebpedersen.co.uk

  • Anonymous

    Thanks a ton. Had 30GB missing on my macbook air. It seems it was a MobileSync folder, 30 bloody GB! I now have half my hard drive back, thanks a lot.

    • http://www.mikesel.info/ Mike Hudson

      Glad I could help Paul! 

      Thanks for taking the time to post a comment.

    • http://twitter.com/Bulldog34471 Srin D

      I realize this is six months old.  But in case someone else is reading this…the Mobile Sync Folder is where your iphone and ipad back ups are stored

    • http://twitter.com/Bulldog34471 Srin D

      I realize this is six months old.  But in case someone else is reading this…the Mobile Sync Folder is where your iphone and ipad back ups are stored

  • Walter Moore

    You are a God and a life-saver.  I could not for the life of me find my iWeb website.  You saved me HOURS of work.  Memo to the folks who designed iWeb and Lion:  I love you, I really do, but PLEASE don’t hide my critical files from me.  I’d like to know where they are, and what they’re called.

    • http://www.mikesel.info/ Mike Hudson

      Thanks for the comments Walter, it’s feedback like this that fuels my blog posting! Glad I could help!

  • Yiannis Pavlou

    Mike. Its people like you that make the Apple world continue to go round. After hours of frustration looking for Lotus Notes files hidden under the Library folder I used your recommendation and resolved all my issues. Thank you so much. 

    • http://www.mikesel.info/ Mike Hudson

      Thanks for taking the time to comment Yiannis, I am glad you found my blog post useful! 

  • Anonymous

    Hello,
    I definitely appreciate the help here, as some files I need to see are suddenly invisible!

    However, I don’t get a couple of things in your instructions:
    Step 6.  I have a Finder window open, but I don’t know what you mean by “icon” in this case.
    Step 7. “Relaunch” what?  Do you mean “restart” the computer from the Apple menu?

    Please help!

    Thanks,
    Matthew

    • http://www.mikesel.info/ Mike Hudson

      Hello Matthew

      Sorry you found the instructions difficult to follow.

      On step 6, I meant right click on the Finder icon in the Dock, it’s generally the icon on the far left of the dock and is a face with two shades of blue. Right clicking with the alt button pressed will give you the force relaunch option.

      Step 7, as per step 6 really – or a reboot would force the relaunch too.

      If you get stuck, let me know.

      Cheers
      Mike

      • http://www.facebook.com/alabastida Adrian E. Labastida Cañizares

        THanks i was actually looking to which finder icon did you meant, i was doing right click on the icon at the top right corner of the screen lol, worked great!!

        • http://www.mikesel.info/ Mike Hudson

          Ahh – Sorry for the confusion, I mean the finder icon in the dock. 

  • Jennifer Bailey

    Not working as of 10/2/11

    Nothing happens, no change, hidden files still showing :(

    • http://www.mikesel.info/ Mike Hudson

      Hello

      Do you get any errors in the terminal? Have you restarted ‘Finder’? Are they still visible after a reboot?

      Thanks
      Mike

  • Anonymous

    After weeks when I thought sanity had gone – YOU saved the day(s) !!

    Now located the missing folder and file – thanks a zillion, huge help .
    :-)

    • http://www.mikesel.info/ Mike Hudson

      Glad I could help Ian, and thanks for taking the time to comment.

  • http://pulse.yahoo.com/_HTEFCDAVK3DUSZFGWG32FNKP7Y Phil Doughty

    Thanks – Worked nice

    • http://www.mikesel.info/ Mike Hudson

      Glad I could help Phil.

      Thanks for taking the time to comment.

  • Mark Clemons

    It worked great.  Thanks for the help.  A question though, the files are visible but greyed out? I’m the only user on this macbook pro so I guess there’s a higher login than I’m aware of.

    • http://www.mikesel.info/ Mike Hudson

      Hi Mark

      Glad you managed to get it working. The fact they are greyed out is just to indicate they are hidden files. Mainly so you don’t go deleting them. You can still access them like a normal file.

      Thanks for taking the time to comment.

  • http://pulse.yahoo.com/_ZTCOQOZABX2ITDXZPPFXR5LFVE ms

    WORKS NICELY!

    • http://www.mikesel.info/ Mike Hudson

      Thanks for taking the time to comment. Glad it worked for you.

  • Anonymous

    Thanks or sharing this, I had trouble migrating my Thunderbird mailboxes and account from a HD with Os Leopard to Os Lion on a bigger HD, I couldn’t find the Thunderbird folder on the system running Os Lion. Now my account is up and running. Thanks again. Do you recommend turning “Show all files” off?

    • http://www.mikesel.info/ Mike Hudson

      Thanks for taking the time to comment. As long as you don’t go deleting files you don’t recognise or tinkering with things you don’t understand leaving it on is safe enough :)

  • Silvis Samitis

    This is great user friendly tutorial. Thanks. 

  • http://twitter.com/wirtzepol Pol Wirtz

    Thanks a lot. This post helped me out when I had for no known reason hidden files SHOWING  all over my Finder…   I only used the second half of your recommendation and this solved it all!

    • http://www.mikesel.info/ Mike Hudson

      Thanks for taking the time to comment, glad I could help out..

  • Dave Davidson

    Hi, I followed the advice as written. On my terminal when I hit return, I received the error message:
     
    2011-11-16 00:09:49.141 defaults[2499:707] Could not write domain com.apple.Finder; exiting.

    Has any one got any ideas?

    Thank you

    • http://www.mikesel.info/ Mike Hudson

      This could maybe be permissions Dave, are you logged on with an Admin user account? 

  • http://pulse.yahoo.com/_4SCWRR3VD67DXAOXCWB73BQUUY Arash

    This is nice, do you know how to make a specific folder visible , not all of them?- Tnx!

    • http://www.mikesel.info/ Mike Hudson

      Sorry for the delay Arash

      You can use: 

      chflags nohidden  

      Replacing with the path/name of the file or folder

      Thanks
      Mike

  • http://pulse.yahoo.com/_PE6D2UJXOYAOXYA63ET2NPCU4A Brandon

    Awesome.  Thank you very much, this worked perfectly.

    • http://www.mikesel.info/ Mike Hudson

      Thanks for taking the time to comment.

  • Pingback: how can i delete files that don’t show up in a search but show up in a virus or spyware scan?

  • Christian Dubuc

    Great! Now, is there a way not to control the visibility of these files but per folders? I like the ability to see all the files but would like to keep them hidden from my desktop.

    Thanks for the help,

    Chris

    • http://www.mikesel.info/ Mike Hudson

      Hi Cristian

      Thanks for taking the time to comment. As far as I know it’s an all or nothing approach I’m afraid.

      Thanks
      Mike

  • http://about.me/liy liy

    thanks! some folders went hidden in my hard drive for no reason and this helped me find them :)

    • http://www.mikesel.info/ Mike Hudson

      Thanks for taking the time to comment. Glad I could help.

      Mike

  • Sharan Maharjan

    HI Mike, i guess there’s not any answer to remove the “.” that is in front of hidden files. I wish  to know about this and if u can help me…waiting..
    isharan

  • Anon Internet

    Thank you so much! I need to uninstall a program and I can’t completely uninstall it unless I can see hidden files. 

    • http://www.mikesel.info/ Mike Hudson

      I’d suggest using a third party application to remove software, something like AppCleaner if you are on a budget http://www.macupdate.com/app/mac/25276/appcleaner 

      Or - http://www.mikesel.info/cleanmymac-os-x-lion/ 

      Thanks for taking the time to comment. 

  • http://twitter.com/IDEA_org IDEA.org

    Also, you can adjust visibility of individual files with: 
    chflags nohidden filenamehere
    or for all the files, recursively, in the current directory: 
    chflags -R nohidden *

    • http://www.facebook.com/people/Seppl-Kretz/643905209 Seppl Kretz

       Very usefull comment! But what did you mean by that last code? chflags -R nohidden *     Because I can’t seem to get that working.

  • Pingback: Favorite terminal command in Lion | jibranbisharat.com

  • zohnyandgazz tarekandhussein

    omg you saved my life man thank you so much, my life was missing and it just popped back up lol
    cheers man

    • http://www.mikesel.info/ Mike Hudson

      Glad I could help :)

      Cheers
      Mike

  • Pingback: Showing hidden files in Mac’s Finder | Jonsomnia

  • Anonymous

    You’re a lifesaver! Thanks.

  • Keith Shauger

    Beautiful. Very clearly explained.

  • http://www.creatingfilm.com/ SamWelkerTV

    Thank you very much :)

  • Jim Sander

    I took this to the next step and created a “toggle alias”, and if somebody has an api method to do the relaunch of finder, the function will be complete

    I put the following in my .bashrc:
    toggle_hidden() { val=`defaults read com.apple.Finder AppleShowAllFiles` case $val in YES) newval=NO ;; NO) newval=YES ;; esac defaults write com.apple.Finder AppleShowAllFiles $newval  && echo display all $newval}

    alias th=”toggle_hidden”

    • http://www.mikesel.info/ Mike Hudson

      Thanks Jim

      That’s a good idea, thanks for sharing and taking the time comment.

      Do you think you could use the AppleScript in this tutorial here: http://still-scripts.com/applescript/how-to-relaunch-finder-with-applescript-and-save-as-an-application/

      Thanks
      Mike

  • Jim Sander

    I took this to the next step and created a “toggle alias”, and if somebody has an api method to do the relaunch of finder, the function will be complete

    I put the following in my .bashrc:
    toggle_hidden() { val=`defaults read com.apple.Finder AppleShowAllFiles` case $val in YES) newval=NO ;; NO) newval=YES ;; esac defaults write com.apple.Finder AppleShowAllFiles $newval  && echo display all $newval}

    alias th=”toggle_hidden”

  • Pingback: Mojang Releases Minecraft 1.1 — But Don’t Update Just Yet | FinalScore MC

  • nitin bharara

    guys forget this crap use “totolfinder”

    • http://www.mikesel.info/ Mike Hudson

      Thanks Nitin

      However, I am a bit of a purest, I’d rather use stock tools rather then 3rd party apps :)

  • Pingback: SEO friendly URLs in OpenCart that works - Blissful Interfaces

  • gio kanaan

    Thanks a lot dood , It helped solve why my hard drive was auto ejecting it would help a lot if you could do a post on that subject.

  • Pingback: Show hidden files in OSX « Niall’s Blog

  • Pingback: htaccess files missing on mac - DesignersTalk

  • http://twitter.com/sirvonsirvon sirvonsirvon

    thanks man!

  • Taylor Cichy

    Worked Great!! I am using it to get music off an old iPod, I can now see everything but it won’t let me move the files anywhere. Do you happen to know another clever trick to save my music?? My old computer crapped out and now this is the only thing I have left with most of the music! I really don’t want to resort to a 3rd party app… Thanks!!

    • http://www.mikesel.info/ Mike Hudson

      Hi Taylor

      Thanks for taking the time to comment. I’m not aware of anyway of doing it without a 3rd party app.. I generally use iExplorer http://www.macroplant.com/iexplorer/

      Let us know if you do manage to do it without apps..

      Cheers
      Mike

  • Pingback: Show hidden files Mac OS X 10.7 Lion : ????? ?????????

  • lovedbyGod2

    this worked perfectly for me! Thank you!! 

  • e2912

    Hi, thanks for the info…i want to know how to make it with an iPod touch,

    Thanks,
    Matt

  • http://twitter.com/nickopris Nick Opris

    Thanks Mike, works like a charm.

    • http://www.mikesel.info/ Mike Hudson

      Thanks for taking the time to comment Nick.

  • Pingback: Solving small problems with .htaccess

  • http://profile.yahoo.com/NGVIQUJQTOVBWEJZYUYR2PIG7I Aldy

    Hi Mike.. this is very help full. last time i use Houdini to show/hide files and folders on Finder (Snow Leopard).

    My issue is now my macbook pro running OSX Lion 10.7.3 and i already Installed Tuxera NTFS since my External Drives were on NTFS. But Lion hide all the Files/Folders with the attribute ‘hidden’ set in PC. (it still show up in Snow Leopard) now and i can’t get it back.. 

    My question is, is there anyway i can set the attributes back to ‘unhidden’ to show it back to normal in Lion? in Terminal maybe?

    Thank you so much.
    Regards.

    • http://www.mikesel.info/ Mike Hudson

      Hi Aidy

      I would try cd’ing to the drive/folder in terminal, then running: 

      chflags -R nohidden *

      That should clear the flag.

      Thanks
      Mike

  • Pingback: Success! | Amanda Goodman

  • Richard Peterson

    Do you know how a file I use regularly would somehow go invisible for no reason?  How do I make that one file visible again permanently, without making everything visible? 

    • http://www.mikesel.info/ Mike Hudson

      Without knowing the file, or what you are using it for Richard that’s difficult to say. You can use the following in terminal:

      chflags nohidden 

      Passing the path and name of of the file in place of the , thanks for taking the time to comment. An let me know how you get on.

  • http://www.mikesel.info/ Mike Hudson

    Hi Mike, I no longer have access to 10.6.8 but there’s no reason this shouldn’t work.

    Thanks

  • Ilesh Patel

    Hello. I was using an app called Secret Service (v 1.0) to hide some work docs. Just upgraded to 10.7 and now the app won’t launch due to no PPC support. I restored the entire Time Machine backup done prior to the 10.7 upgrade to another mac. Secret Services launches but it shows the path to the hidden folder but is not able to unhide the folder.
    Is there some way to retrieve the hidden folder without launching that app? none of the suggestions below bring up the hidden folder.
    I was not sure about doing a complete restore of the backup to the original computer incase it deletes the hidden folder in the process.
    Many thanks for any help you can give.

    Ilesh

    • http://www.mikesel.info/ Mike Hudson

      Hi do you know the path to the files/folder? If its just hidden then you should still be able to navigate to it. If its protected too, it may be harder, but not impossible.

  • http://twitter.com/IAmMarveloso Marvis Brown

    I followed the advice as written. On my terminal when I hit return, I received the error message: 2011-11-16 00:09:49.141 defaults[2499:707] Could not write domain com.apple.Finder; exiting.
    Has any one got any ideas?

    • http://www.mikesel.info/ Mike Hudson

      Hi Marvis, Check out the post over at https://discussions.apple.com/thread/3340019?start=0&tstart=0 that should resolve your issue.

      Thanks
      Mike

  • http://www.facebook.com/grweiner Garrett Weiner

    I have the same issue, but have no clue why I can’t find ‘the utilities’ folder in finder.  at least not the folder you are talking about. Then now to open up a terminal window in Mac?  sorry, just not good with this – but need the help.  Thanks

    • http://www.mikesel.info/ Mike Hudson

      How about if you launch finder, then in the menu bar click utilities? 
      Or type terminal into spotlight?

      Thanks
      Mike

  • Jono James

    Awesome Thanks.

  • David Scharf

    I’ve written a small cocoa tool which wraps exactly these commands into an interface which resides in the toolbar. Finder restarting is also supported: http://filetoggle.huesforalice.com/

    • http://www.mikesel.info/ Mike Hudson

      Thanks David

      That’s a handy util, thanks for sharing.

      Mike

  • jimhales

    here is what I get when I try and unhide hidden files to find malware applications running on my iMac. can’t seem to access files containing adware releventknowledge.ba or bearsharemanagerfree.exe
    Last login: Sun Apr 22 07:47:26 on ttys000cpe001f5be74ccb-cm001bd7a6efae:~ jimhaleschuk$ bashbash-3.2$ defaults write com.apple.Finder AppleShowAllFiles YESbash-3.2$ bash-3.2$ defaults write com.apple.Finder AppleShowAllFiles YESbash-3.2$ bash-3.2$ com.apple.Finder AppleShowAllFiles YESbash: com.apple.Finder: command not foundbash-3.2$ 
    Can anyone help me with this. Email me at jshales@rogers:disqus .com, then I can for sure get the info i need

    • http://www.mikesel.info/ Mike Hudson

      Hello Jim – you might want to try David Scharf’s link in the below comment: http://filetoggle.huesforalice.com/ this should do it for you.

      Thanks 
      Mike

  • Cary_Wolfson

    I feel like I’m missing something here. After pasting the command into Terminal, why the reference to the “alt” key, which doesn’t exist on a Mac? Where is the Finder icon I’m supposed to click on?

    OK, what I’m trying to do: on startup I get the message that the file Library/StartupItems/ProTecb cannot launch. No idea what that is, but I want to trash it. However, I don’t see any files in the StartupItems folder, and it doesn’t show up in a Spotlight search, so figure it must be invisible.

    • http://www.mikesel.info/ Mike Hudson

      Hi Cary 

      I’m in the process of making a video to make this easier, however in the mean time… 

      The alt key is the one that looks like the attached, and finder is the two faces in your dock (see attached)

      Once you’ve done that, you should find you can see the files your after

    • Cary_Wolfson

      Thanks for the quick response, Mike.

      OK. In my world we call that the Option key, but whatever.;-}>

      In the meantime, I’ve found a freeware app, Lion Tweaks, that avoids all the command line stuff. Check it out here: http://ifredrik.com/applications/download_step.html

      Even so, I still have not been able to find that “ProTecb” file. No idea what it is or is supposed to do. Must be a dreg left over from an anti-virus program or something.

      • http://www.mikesel.info/ Mike Hudson

        Hehe, well on my mac it’s labelled as Alt :P  

        Thanks for the link, I am not a massive fan of tweak apps, but if you prefer that.. 

        Have you tried something like CleanMyMac http://www.mikesel.info/cleanmymac-os-x-lion/ Should find and clean up any application left overs.

        Thanks

        • Cary_Wolfson

          Thanks for the tip. I’ll check it out. I was using something called MacKeeper. “Upgrading” to Lion last week hosed so many things I was running under 10.6.8. It seems like I’ve done nothing but put out fires since I made the change. Feels like my head is about to split open. Glad there are people like you willing to help out.

          • http://www.mikesel.info/ Mike Hudson

            Yeah I’ve tried that. I prefer CleanMyMac. Much easier interface.

            Upgrades between OS versions are always best doing from fresh installs in my opinion. :o )

            Stick with it, Lion will earn its right to your disk space :)

            Like you say. There’s plenty of people like us out there willing to help.

            Cheers
            Mike

  • http://raamdev.com Raam Dev

    Thank you, Mike! Very helpful. :)

    • http://www.mikesel.info/ Mike Hudson

      Glad my tutorial helped out :o )

      Thanks for taking the time to comment.

  • J Dr

    defaults write com.apple.finder AppleShowAllFiles TRUE killall Finder

    will do the job. if you have trouble, you should copy paste the whole line only until TRUE and then type killall Finder by hand.

    and then to reverse:

    defaults write com.apple.finder AppleShowAllFiles FALSE

    hit enter and then type:

    killall Finder

    hit enter and magic done.

    ps. I post that because YES or NO commands didn’t work for me

    • http://www.mikesel.info/ Mike Hudson

      Thanks for taking the time to comment, and for your suggestions. :o )

  • http://profile.yahoo.com/IVVYW7VTJDJQVKPEWLFA3QGLT4 Cartoonist Miller

    Oh my gosh thanks Mike, that was very helpful. I have a 16 GB flash drive and I could never get stuff on there. Turns out the flash drive actually keeps the items it had before. I went into trashes and then got rid of 503 and 505. I now have 15.987 GB!

    • http://www.mikesel.info/ Mike Hudson

      Glad my tutorial helped out :o ) Thanks for taking the time to comment.

  • http://twitter.com/Nanusja Nanusja

    Thanks a lot!! It really helped!! 

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!