Super User is a question and answer site for computer enthusiasts and power users. 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 understand the tilde (~) at the end of a file displayed in bash is a backup file in the Linux file system. Is there a way to keep these hidden when listing the contents of a directory?

share|improve this question

migrated from stackoverflow.com Jun 7 '11 at 21:21

This question came from our site for professional and enthusiast programmers.

1  
That's not defined "in the Linux file system" (there isn't a "Linux file system"). It's just defined by convention, and certain tools assume that's what it means. – Daenyth Jun 7 '11 at 19:04
up vote 3 down vote accepted

"ls -B" will ignore backup files, too.

share|improve this answer

You can use ls --hide='*~' to not show files matching that pattern. You could add an alias for it in your shell's rc file like this:

alias ls="ls --hide='*~'"
share|improve this answer
    
You mean alias ls="ls --hide='*~'". – Daniel Cassidy Jun 6 '11 at 16:23
    
Yes, thanks. Remember both questions and answers here are like wiki pages, you can edit them and fix mistakes yourself. That would have been a good candidate for a quick fix. – Caleb Jun 6 '11 at 16:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .