Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
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
add comment

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

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

2 Answers

up vote 3 down vote accepted

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

share|improve this answer
add comment

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
add comment

Your Answer

 
discard

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.