How to set files as Hidden/Unhidden

Discussion in 'OS X' started by justinlt99, Oct 14, 2007.

  1. macrumors newbie

    Joined:
    Sep 12, 2006
    Location:
    Houston, TX
    #1
    Okay, I know how to set OSX to let you view the hidden files on your hard drive. However, what I can not figure out is how to actually change these files to be "unhidden" once you have them viewable. Anyone know what to do?
     
  2. macrumors regular

    macjack1

    Joined:
    Oct 3, 2007
    Location:
    The Big Apple
    #2
    Launch Utilities/Termimal and enter:
    Code:
    defaults write com.apple.Finder AppleShowAllFiles YES
    press enter

    When you no longer want it visible, write:

    Code:
    defaults write com.apple.Finder AppleShowAllFiles NO
    press enter

    It is better to use an encrypted folder for this.

    EDIT: Or are you referring to something like this topic support topic?

    There is also this GUI,"Unhide Utility", which may be more to your liking. I have not used it myself so cannot recommend it.

    -mj

    -mj
     
  3. thread starter macrumors newbie

    Joined:
    Sep 12, 2006
    Location:
    Houston, TX
    #3
    I'm not talking about making it visible --- I know how to do that. I mean to change the actual status of the file so that it is no longer physically a hidden/invisible file.
     
  4. macrumors regular

    macjack1

    Joined:
    Oct 3, 2007
    Location:
    The Big Apple
    #4
    I believe you can use Developer Tools for that if they are installed: /Developer/Tools/SetFile -a V /Users/~/filename

    -mj
     
  5. macrumors regular

    Joined:
    Aug 20, 2010
    #5
    I used this command and I found my deleted files and where my Trash is actually located on my HD. In my home folder is a hidden file named ".Trash". I was curious, what happens if I delete the ".Trash" file and send it to the Trash? Is this possible? Will my system crash? What happens? lol I don't want to do it myself and possibly risk permanently deleting my Trash.
     
  6. macrumors 6502a

    upaymeifixit

    Joined:
    Feb 13, 2009
    #6
    I've done this before accidentally. I think I typed in: sudo rm ~/.Trash or something like that. I found out all it does is sends it to the /.Trashes folder that every volume has on it. That folder is then rebuilt when you log in (I restarted). Now I think I've deleted the /.Trashes folder before, but I don't really remember.

    I have a question. What is -rf for? (Often seen in sudo rm -rf *dir*)
     
  7. macrumors 65816

    Joined:
    Sep 19, 2009
    #7
    ?

    All one needs to do is use Terminal to remove the "." that is in front of hidden files.

    To use my bash_profile file (a commonly accessed hidden file for some) for example:

    Code:
    $ pwd
    /Users/MyUsername
    $ ls -a
    .bash_profile
    $ mv .bash_profile bash_profile
    $ ls 
    bash_profile
    
     
  8. Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #8
    Some files/folders are hidden without them having a dot in front of their name, such as /var/. Also, when you already know the name of the file, you can directly access it anyways without renaming it, e.g., open -t .profile

    The -r is for recursive, the -f for force (no confirmation). Type in "man rm" for more details.
     
  9. macrumors newbie

    Joined:
    Jul 29, 2011
    #9
    Still unanswered...!

    This is a great question, and it hasn't been entirely answered. If you set a file to "hidden," how do you undo such an action?

    Part Two of my question gets even trickier: On my old PC, I made a few photos hidden. (Let your minds wander.) When I transfered all my photos to my beautiful new MacBook, they remained hidden. If I use Terminal commands to view them, they become visible; however, they remain hidden files. So although I can see them as faded photo icons, they can not be "unhidden" like the rest of my photos. How do I fix this mess and set these PC-hidden photos to be completely visible at all times?

    And please, everybody, understand that "hidden" is NOT the same as "invisible." My PC photos are hidden files that are invisible; Terminal commands make them visible; I want the file to be unhidden.

    Thanks for the help, iFriends! :D
     
  10. macrumors G4

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #10
    Terminal to the rescue again.
    Code:
    chflags hidden /path/to/file.ext
    ... will hide a file (no developer tools required)
    Code:
    chflags nohidden /path/to/file.ext
    ... will unhide a file (no developer tools required either).
     
  11. macrumors newbie

    Joined:
    Jul 29, 2011
    #11
    Can you be a bit more specific with what I need to plug into the equation, wrldwzrd89? I'm a bit dumb with computer language.

    Let's say, for example, that the photo can be found in the folder called "July 2011", which is in the larger folder called "College," which is finally sorted under the main Mac folder called "Pictures." We'll say the file name is "Crazy Night Downtown 023."
     
  12. macrumors 6502a

    upaymeifixit

    Joined:
    Feb 13, 2009
    #12
    chflags hidden ~/Pictures/College/July\ 2011/Crazy\ Night\ Downtown\ 023.jpg
     
  13. wrldwzrd89, Jul 30, 2011
    Last edited: Jul 30, 2011

    macrumors G4

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #13
    You can also just drag & drop the file onto the Terminal window, assuming you can see it in the Finder, after typing the chflags nohidden (or chflags hidden) part, then a space.
     
  14. macrumors newbie

    Joined:
    Oct 7, 2014
    #14
    You can drag and drop multiple files and folders. Terminal magic makes them Visible.
     

Share This Page