Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need help, 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?

share|improve this question
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 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
up vote 2 down vote accepted

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.

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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