I have a folder which I want to hide, but not by prepending a dot, because then you just need to enable "View hidden folders" in the file manager. I don't want that - I want it to be REALLY hidden, so that it does not appear neither in the file manager (I'm using Thunar, if it matters) nor in the output of ls
. It should be still accessible by it's name, though (else I could just delete it). Example:
~$ ls -a
folder_to_be_hidden
some_other_folder
~$ some_thing_to_hide_a_folder_or_file folder_to_be_hidden
Successfully hidden folder_to_be_hidden !
~$ ls -a
some_other_folder
~$ ls some_other_folder
some_file
another_file
~$
Is this possible at all ? I'm using Ubuntu Studio 20.04, if that matters.
P.S.: I need this to hide some folders from being found when someone else accesses my machine over SSH, that's why it's not enough for them to be hidden in the file manager ! They also should not be able to see that I'm hiding the files from them. At the same time, for those who know about the files / folders (me), they should be still accessible by just putting their path.
~/Mine
, and store your banking details in~/Mine/banking
. I guarantee, nobody will see your banking details. – matigo Mar 31 '22 at 15:53r
(read) access to the parent directory can easily see the "hidden" file. – waltinator Mar 31 '22 at 17:36.hidden
in your home directory, and then add files/folders names that you wish to hide, to the.hidden
text file. – heynnema Mar 31 '22 at 20:20ls
in the terminal, right ? – TheEagle Mar 31 '22 at 21:11ls
command that will remove-a
,-A
or-f
options passed to the command, ie. options that cause files beginning with dot to be shown. However, listing the directory in other way than usingls
will still show your "hidden" files. There is no option in Linux to "totally" hide files like you want. – raj Mar 31 '22 at 21:38ls
. Could you just change the folder protection so that "others" doesn't include r/w? – heynnema Mar 31 '22 at 21:53