How to set files as Hidden/Unhidden

justinlt99

macrumors newbie
Original poster
Sep 12, 2006
7
0
Houston, TX
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?
 

macjack1

macrumors regular
Oct 3, 2007
101
0
The Big Apple
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
 

justinlt99

macrumors newbie
Original poster
Sep 12, 2006
7
0
Houston, TX
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
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.
 

eah2119

macrumors regular
Aug 20, 2010
111
0
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.
 

upaymeifixit

macrumors 6502a
Feb 13, 2009
787
1
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.
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*)
 

mac2x

macrumors 65816
Sep 19, 2009
1,146
0
I believe you can use Developer Tools for that if they are installed: /Developer/Tools/SetFile -a V /Users/~/filename

-mj
?

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
 

angelwatt

Moderator emeritus
Aug 16, 2005
7,852
7
USA
All one needs to do is use Terminal to remove the "." that is in front of hidden files.
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

upaymeifixit said:
I have a question. What is -rf for? (Often seen in sudo rm -rf *dir*)
The -r is for recursive, the -f for force (no confirmation). Type in "man rm" for more details.
 

MACaRHOni

macrumors newbie
Jul 29, 2011
5
0
Still unanswered...!

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?
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
 

MACaRHOni

macrumors newbie
Jul 29, 2011
5
0
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."
 

upaymeifixit

macrumors 6502a
Feb 13, 2009
787
1
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."
chflags hidden ~/Pictures/College/July\ 2011/Crazy\ Night\ Downtown\ 023.jpg
 

TwentyPeace

macrumors newbie
Oct 7, 2014
1
0
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.
You can drag and drop multiple files and folders. Terminal magic makes them Visible.
 

Jdp1972

macrumors newbie
Mar 21, 2020
1
0
Having same issue. I transferred old files that I had on external hard drive to my 2018 macbook pro and some are hidden. Want to make them permanently visible. Already tried using terminal and followed instructions above. chflags nohidden (dragged folder) hit enter. Folder and contents remain hidden.
 

KALLT

macrumors 603
Sep 23, 2008
5,065
3,083
Having same issue. I transferred old files that I had on external hard drive to my 2018 macbook pro and some are hidden. Want to make them permanently visible. Already tried using terminal and followed instructions above. chflags nohidden (dragged folder) hit enter. Folder and contents remain hidden.
The solution depends on what makes them hidden/invisible in the first place.
  • If the file/directory name begins with a ., then you can only temporarily unhide it by configuring Finder (see post #2 or use the following keyboard shortcut in Finder: shift + command/alt + ..
  • If the file has the Unix file flag hidden, then it can be removed by calling chflags nohidden <file> in Terminal.
  • If the file has an Apple-specific file attribute, you can remove that with setfile -a v <file> (note the lowercase v).
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.