What about hidden files in Fedora? How does one hide, or unhide files? I know this is possible because I was using k3b, the CD/DVD creator, which asked if I wanted to include “hidden files”.
To my surprise, when I answered “yes”, to my surprise, it unhid and added to the project very many formerly hidden files.
I am not talking about dot files, like .bash_profile, but some sort of attribute that gets set, similar to, but more complex than Windows. I know it exists but looking over a ton of documentation left me nowhere.
I only know of 2 ways to hide files.
First is the leading dot (.) in the file name.
Second, and it is not common, is for the first character to be a non-ascii character. I have seen that happen many years back with a bot that was installed on one of my systems that was hacked.
I know of nothing else that can hide a file from the command line, although within gui apps it is possible to exclude displaying files that match a pattern.
Nautilus (files) by default hides the dot files but can be toggled to display them or not as you noted.
K3b uses similar rules to ‘ls’ and ‘nautilus’. It does not select/display the hidden files until you tell it to do so.
Was this from the POV of K3B? It may just plain ignore some file types and “hide” them from viewing as a normal feature. Usually burning a disk is irreversible unless CD-RW is being used, so I would think there would be a default sane configuration for it to ignore certain file types (like hidden ones) under normal use.
[Edit] There is setfattr and getfattr that are used for extended file attributes on any filesystem, and attr which is specifically for XFS I think. But I have always hidden directories and files with the leading dot.
You can limit access to the files by group or user so GID or UID range even. You do this with chmod.
Permissions can be used to limit access, yes, as in setting the file with no read permissions for the user. However, permissions cannot ‘hide’ a file name unless the directory is not readable, in which case the user cannot even see the content of the directory. If the directory is readable the file names will be readable, even if the content of the file is not.
There are lots of permutations on access using permissions.
Lets consider a user A & D who are neither the owner nor in the group that owns directory B and B contains a file C.
B has permissions rwxr-x--x
C has permissions rw-r--r--
User A who knows the name of C can read it with ‘cat B/C’ even though he cannot see it in directory B because he does not have read permissions to B. As long as he has execute permissions and knows the file name he can use cat, or many other commands, to access files contained in B. He cannot use ls since that requires the read permission on the directory.
User D who does not know the name of C cannot even read it because he does not have read permissions to B, cannot see the file name for access, and without knowing the name of C has no way to access its content.
This is just one of many permutations available with judicious use of permissions.
I understood that, I wasn’t certain though what the original poster was actually referring to though since I’ve only ever hidden something on linux with a leading dot. I suppose looking into posix file handling and what can be done, it may be that you can do it with special characters in the file header, but I haven’t ever felt the need to.
FWIW, if I was going to try to ensure any files I had, that I didn’t want just anyone to view, I would encrypt them.