Follow

Did you know most file managers on Linux support a ".hidden" file in your home directory?

It works pretty much as gitignore does: it hides everything that you list in this file, one file/dir per line.

fosspost.org/tutorials/hide-fi

@fribbledom
You just have to remember they can easily be found by using ls -a

@I_Will_Wobble

Yeah, don't mistake this for a security feature. It's just there for convenience when browsing your files in a GUI tool like Dolphin or Nautilus.

@I_Will_Wobble @fribbledom they aren't hidden from standard `ls`, only from GUI file manager, which limits the scope a bit.

@I_Will_Wobble @fribbledom You don't even need the -a option, on the terminal it will still show anyway. But it IS convenient for GUIs.

@fribbledom

But also, if you're using Apache with standard configuration, all .ht* files are hidden, i.e. not served (but you can use them as included files).

@fribbledom fosspost seems offline, cloudflare page presented...

@querdenker

Still works for me. Behind a VPN they block maybe?

@Cedara @querdenker

Oh well, Cloudfare with issues again, by the looks 😒

@fribbledom @Cedara hrmmm... they should rename themself to clownflare.
But just checked - now fosspost is working again

This… is… AWESOME. I had no idea about `.hidden`. This way I can de-clutter my $HOME polluted by a shiton of programs not caring about XDG Base Directory Specification. (beko.famkos.net/t/f1W)

@hansw

No, don't mistake this for a security feature. It's convenience.

@fribbledom Yet another thing I know now that I did not know when I woke up. If I used a file manager, that could be potentially useful.
@fribbledom I knew this about hiding folders, but I didn't know you could hide files like this. Thanks for being informative!

@fribbledom I'm a hard core linux user and this is actually news to me. Though they failed to mention if it worked like dot files in the shell itself, which would be the most important for me as I dont often use graphical fiel managers.

@freemo @fribbledom ls command will list it, it is there just to decullter the system folders, most file managers actually have an option to show/hide hidden files/folders.

P.s: this even works on android

@paradoxicalslacker

Shame, I would have expected it to work more like dotfiles and work with ls in much the same way. I'm sure there is a reason though.

@fribbledom

@freemo @fribbledom if it never gets listed then we would never be able to alter/delete system files/folders and that is against the core philosophy of linux!

@paradoxicalslacker

I never said "never listed". with ls when dealing with dotfiles if you do a ls they are not listed. However you can cause them to be listed by using the -a argument. I would have expected hidden files to work the same, not listed by default but capable of being listed with -a.

@fribbledom

@freemo @fribbledom true, that would be effective. What i meant to say was when an user wants to see the contents of his system he should be able to see it with ls command because system files/folders like cache are by default hidden, so the default list command should list it!

@paradoxicalslacker

Sure, all I'm saying is ideally .hidden should work the same as dotfiles in general.

@fribbledom

@freemo
That means that ls would have to read and parse any .hidden files in every directory, when normally it only reads filesystem entries. And since it already ignores .* files by default, I suspect that might increase runtime of some usages which go through large directory trees in little time. GUI file managers do a lot of GUI stuff, often generate previews and usually show only a single directory level at the same time. No biggie.
@paradoxicalslacker @fribbledom

@Mr_Teatime

There could be a flag to just ignore .hidden should there be a need to boost the speed.

@paradoxicalslacker @fribbledom

@freemo @fribbledom It does not. I just tried it in shell and was slightly disappointed

@fribbledom Pretty cool. On the few occasions that I made file manager screenshots to explain something, I always blurred out the names of my Nextcloud folders, which are named after my two instances. This is much better, thanks!

@fribbledom Most of these issues could be done by giving the right permissions on the system itself. GUI's should not even bother with it, they should only give the right error to the user imho.

@fribbledom And there is one other danger. See how 'crackers' used to find files above the document root. Simply store a script where you can, chmod it and run the script. It will give all of the details, even in the GUI

A better solution, imho, would be to give users that should not see files a chroot shell and store files they should see in a directory there.

Sign in to participate in the conversation
Mastodon

Server run by the main developers of the project 🐘 It is not focused on any particular niche interest - everyone is welcome as long as you follow our code of conduct!