WebUpd8 reader Keshto sent us a very interesting tip about hiding folders in Ubuntu using the Gobolinux Kernel and Gobohide - all available in .deb files (32bit only) for easy Ubuntu installation. You won't get the Gobolinux filesystem hierarchy by using these packages, you'll just be able to "really" hide folders.
What Gobohide does is completely hide some folder you chose at kernel level:
[... ] My suggestion was to hook these read operations directly in the root of the problem: since every readdir() is performed by the kernel, then we could have a list kept in kernel to check on every readdir() operation. If the inode being read was present in this list, then it simply shouldn't be copied onto the destination buffer, which should be returned to the user.
This first implementation was hardcoded with my own inode numbers (relative to the legacy tree), and this was when Felipe Damasio came with his kernel abilities and created a better interface based on ioctls in order to register the entries that should be hidden from the userspace, and then we got our first release of GoboHide.
From these old days until now, GoboHide has been kept up to date to the newer kernel versions. The patch now is fully integrated with the VFS, which means that it works with any filesystem that supports directories and/or symlinks. It has been tested with EXT2, EXT3, ISOfs, JFFS2, JFS, NFS, ReiserFS, SquashFS and XFS, but certainly works with others, too.
-- info via Gobolinux
Once a folder is hidden, it doesn't show up in the file manager (if the folders were already displayed, refresh Nautilus - CTRL + R), terminal or any other place anymore. However, the folders are still accessible as long as you know their exact path - you can type it in a file manager or terminal and access the files inside them without having to unhide them.
In my test, typing the exact path to a hidden folder never worked the first time but always worked the second time. This might be a bug or just some weird issue on my system, anyway in case this happens to you too, just try it again and it should work.
Firstly make sure you install all 3 .deb files (download link at the end of the post) and restart your computer. Then, to hide a folder use the following command:
sudo gobohide -h /path/to/folder/to/hide
To unhide a folder use:
sudo gobohide -u /path/to/folder/to/unhide
To list the currently hidden folders use:
sudo gobohide -l
You can also see all these commands in the screenshot in the beginning of the post.
Since I'm not the one who has created these .deb files I cannot give you any guarantees so use them at your own risk! Also, use them in Ubuntu 10.10 Maverick Meerkat only (I have not tested them with older Ubuntu versions)!
Download Gobolinux Kernel and Gobohide (install all 3 packages)
Thanks to Keshto for the tip | via k2z