I want to be able to check whether a file is hidden or not in Cent OS 6.3. These are often referred to as (dot) files but I can clearly see Cent OS 6.3 handling these by appending a ~(tilde) to the end


myfile (not hidden) myfile~ (hidden)

Now, I can tell that a file is "hidden" if it's a dot file, but what is going on with this tilde (~) terminating character - is this particular to Cent OS 6.3? Is this something I can simply check for in the file name (EG: starting with a dot or ending with a tilde) I would appreciate help on this as, I would assume "hidden" is a file attribute rather than a "naming convention" as I wrong?

  • 3
    There is no “hidden” file attribute, any hiding is done by the software listing the files. So which program are you using that's hiding files? – Gilles 'SO- stop being evil' Nov 1 '12 at 18:15
  • Is this for tab completion inside the bash shell? If so, check the value of the FIGNORE variable using echo $FIGNORE. – Mikel Nov 1 '12 at 18:33
  • they are "hidden" in nautilus ("show hidden files") – user26676 Nov 3 '12 at 12:34

A tilde suffix marks a backup file for a few text editors, such as Emacs ('~') and Vim ('.ext~').

Some programs hide these files, as most people don't care about them.

The only universal convention for a 'hidden' file is a file with a leading '.', due to a feature-like bug which was widely adopted.

  • thanks for the link - I suspected it was some kind of "retcon" _ I am syncing files and I want to ignore locked files, hidden files etc so thanks for the info – user26676 Nov 3 '12 at 12:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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