Random software keeps on creating folders in my home folder which gets messed up and disorganized. I decided to clean things up. I added a dot . in the beginning of the folder's names in order to hide them, but quickly realized that dot affects folder names and folders weren't found by the software anymore. I ended up with a broken software...

So it looks like for the moment in Unix & Linux it is either disorganized folder structure or disfunctional software.

This is bugging me and I am asking if there is alternate way of hiding folders and files without affecting functionality?

Biased part of the question:

In my opinion it is unwise to look at the OS just from perspective of functionality but also beauty. chmod and chown are there to take care of the functional part (file and folder protection), so using . becomes redundant except from perspective of beauty (hiding files). Instead . also affects the name and interferes with functionality. Therefore my opinion is that we need a different mechanism to hide files without affecting the functionality.

closed as primarily opinion-based by dr01, countermode, Wouter Verhelst, Toby Speight, jasonwryan May 23 '17 at 0:28

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 2
    Forget about hiding. Play with permissions – Romeo Ninov May 22 '17 at 6:13
  • git or any other VCS supports ignore lists. – rudimeier May 22 '17 at 7:21
  • While this question is valid I think you should ask yourself whether you really need this. I would argue that there are not many use cases for hiding. – phk May 22 '17 at 7:33
  • 4
    I beg your pardon, but what are you actually asking? Not displaying Files beginning with a dot is pure convention. The kernel itself does not care, from its perspective there is no such concept as hidden files, i.e. there is no file attribute for this. So we are left with: In my opinion Linux developers could present us with a better mechanism ... what for? Use case where that really matters? Improvement worth the effort? – countermode May 22 '17 at 8:01
  • 1
    @71GA How else should I look at it. Have you ever used IT in a production environment? Nobody cares about beauty. random software just keeps creating folders in my home folder and totally ruins my organisation - eh, what?! Are you watching the ls -l output and admiring its beauty?! – countermode May 23 '17 at 7:24

The real solution to put a file out of the way is to put it in a different directory.

Files whose name begin with a dot are hidden by default in some software, out of ancient Unix tradition. It started with the ls command and has been imitated by many, but not all, file managers.

There is a proposal to hide files whose name is listed in a file called .hidden, which originated in Gnome. It doesn't have very widespread support. You could try using it but don't expect all the software that your users use to hide them. If users see the files in some software but not in other, this may well be counterproductive — they might delete the files that they see in program A but not in program B, thinking that if program B doesn't show the files then there's something wrong with them and they probably shouldn't be there. For this reason, although I inform you that this feature exists but I recommend against using it.

Once again, if you don't want users to mess up with some files, put them in a different directory. And, if applicable, don't give them permission to mess with those files.

  • 1
    hidden is the wrong term to use IMHO. Not displayed by default is the term I use. There is nothing hidden about dorfiles. They are simply not displayed by ls and GUI file managers without an extra option. – fpmurphy May 23 '17 at 1:28
  • I rewrote my question. Gnome seems to be heading in the right direction... – 71GA May 23 '17 at 7:32
  • 1
    Voted to reopen. But IMHO you're looking for something that won't be implemented in the near future. – dr01 May 23 '17 at 7:43
  • I agree. But maybe someday it will be. – 71GA May 23 '17 at 7:49
  • 1
    @fpmurphy1 “Hidden” doesn't mean “invisible”. It means “not currently visible” or “not visible without effort”. So “hidden” is perfectly fine for a file that is not shown by default in directory listings, but can be shown by toggling a setting. – Gilles May 23 '17 at 12:14

Files beginning with a dot (dotfiles) are meant to be used by an application, and usually they specify the application's configuration; they aren't meant to be operated by the end user, which doesn't even need to be aware of them.

So the purpose of dotfiles isn't really to "clean our mess" and ever less to "prevent new users to mess things up" (that's what permissions are for; note that dotfiles can easily be seen via ls -a), but simply to organize files and reduce clutter by separating system-related files (dotfiles) from user-created data.

The reason why there isn't another system in place to hide files is because it was considered redundant, dotfiles having already proven their purpose. Note that in Linux, unlike MS Windows, there is no "hidden" attribute for files, although there are many others (type man chattr to see them).

If you want to prevent users from accessing files, and not simply hide files from them, there are other mechanisms: permissions (chmod), ACLs, up to SELinux access control.

  • Imagine the case when application puts a folder in my home folder and I don't like that, because it is ugly. So if this folder is needed by a program I am unable to move it nor can I hide it to keep my organizaton of files clean (because dot changes the name). What I am stating is that Linux could at least provide a mechanism to hide it without affecting the name... I still don't understand why my question is being marked as a opinion based. It is not. I am exposing a problem afterall... – 71GA May 23 '17 at 6:50
  • Care to explain the downvote? – dr01 May 23 '17 at 7:11
  • 1
    Openbox desktop keeps it's files in ~/.config/openbox and these files are supposed to be manipulated by the end user in order to customize his desktop. This is also sugested in man openbox so . files clearly aren't to be manipulated only by software. – 71GA May 23 '17 at 7:29
  • 1
    @71GA. You are exposing a perceived problem for you - not an actual problem for the majority of users of Unix-like operating systems. – fpmurphy May 23 '17 at 16:18
  • @71GA The meaning of a dotfile it's "this is a system configuration file and not user-created data, you can modify it if you like and you know what you're doing, otherwise keep your hands off" – dr01 May 24 '17 at 6:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.