Hide Select Icons From View (incl Hard Drives) 1

Terminal

Share
Hide Select Icons From View (incl Hard Drives)

Hey

Continuing from a post a couple of days ago about Hiding Hard Drive Icons From Your Desktop and reading into an insight full comment i’ve found a method where you can hide certain hard drive, folders and files from view. A quick method is to normally add a dot in front of the file name so it becomes a “dot-file” for example “.hiddenfile.txt”. This will make the file disappear from view. However this changes the file name and if you have any scripts or applications that rely on the exact file name this can be a problem, it can be even worst when you want to remove a Hard Drive, change the file name of such a volume can be disastrous. Therefore we are going to play around with a couple of Terminal programs to change the attributes of files, folders and even Hard Drives so we can hide them from view.

Before we start you need to have the developer tools installed. Since we use two special Terminal files that get installed when the developer tools are installed. To install the tools simply  insert your installation disk that comes with your Mac or follow this post on Installing XCode. I would just post the two files needed, however I don’t have the right to distribute them.

Once the developer tools are installed we are ready to go. We are going to use two Terminal programs, GetFileInfo and SetFile. The first is used to see the file attributes the second to change them. We are going to change the file attributes so it is hidden. First off open up Terminal under Utilities and type the following, we are going to hide a BootCamp partition, although it can be applied to any file, folder or disk.

GetFileInfo /Volumes/BOOTCAMP

It will post results similar to the following.

directory: "/Volumes/BOOTCAMP"
attributes: avbstclinmedz
created: 01/01/1904 00:00:00
modified: 06/23/2010 13:59:22

The second line is something that we are interested in. It has a line of attributes that we can change, although the letters are meaningless at this point they each represent something that can be changed, we are going to change the visibility attribute so it disappears. In Terminal again, type the following.

sudo SetFile -a V /Volumes/BOOTCAMP

This uses the SetFile program to change the attribute setting (-a) to invisible “V”, for the Volume BOOTCAMP, change the string at the end to anything you want. Use the full path to the file to make sure you don’t hide anything you don’t want.

After a quick moment the hard drive or anything you are hiding is gone. It wont be visible in Finder, but is still there with the original file name. If you are hiding a hard drive and a hard drive icon with the name “client node” appear, simply log off and back on again for it to disappear. I don’t no what it is, but it is relatively harmless.

This trick can be done with pretty much anything, i’ve tested it will files and folders as well and they all disappear. If you want to change anything back so you can see it again, type the following into Terminal.

sudo SetFile -a v /Volumes/BOOTCAMP

All that is change is the attribute item “v”. Its can from on, to off. If you want to see the different that you can change just type “SetFile” into Terminal. Err on the side of caution if you change anything as it may be difficult to revert.

Overall this is a very simple, and quite a useful trick. It could be used to hide your Macintosh hard drive if you have children that like to mess things up. There is quite a few possibilities that can be done with this little program.


If you want to keep up with the latests post from Mac Tricks And Tips I recommend you subscribe to the RSS Feed.

Where To Next?

  • Subscribe To Mac Tricks And Tips