Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Editing text file using Emacs will make Emacs make a companion file for its own purpose.

For example, after first editing a file called test.c, Emacs will leave a file called test.c~ in the same directory. This can be a little annoying when visualizing all files cluttered with the ~ files in a console

Any way to get rid of seeing these ~ files in a console, like the Gnome Terminal?

Update

Thanks to @don_crisst's comment below:

use ls -B to hide the ~ files when displaying file names. The command line switches, -B or --ignore-backups, do not list implied entries ending with ~.

share|improve this question
6  
Is that when using ls ? You can use ls -B. -B or --ignore-backups = do not list implied entries ending with ~ –  don_crissti Apr 25 '13 at 11:50
    
Oh my! That's what I want! Thank you! –  xiaohan2012 Apr 25 '13 at 11:53
    
@xiaohan2012, why don't you write that up as an answer and mark it as accepted. –  slm Apr 25 '13 at 13:52
2  
There should be a law that emacs users have to clean up after themselves or configure it to not do this, honestly. –  TAFKA 'goldilocks' Apr 25 '13 at 14:27
1  
Possibly useful: How do I control how Emacs makes backup files? (has instructions both for configuring where the backup files are stored, and disabling file save backups entirely) –  Michael Kjörling Jun 25 '13 at 7:36
show 2 more comments

1 Answer

up vote 0 down vote accepted

Use ls -B to hide the ~ files when displaying file names. The command line switches, -B or --ignore-backups, do not list implied entries ending with ~.

share|improve this answer
2  
If you are using Bash, see also the FIGNORE environment variable, which allows you to exclude files from tab completion by pattern matching. There is also GLOBIGNORE for excluding files from glob (wildcard) expansion. –  tripleee Jun 25 '13 at 4:58
    
Eye-opening comment. Thanks. @tripleee –  xiaohan2012 Jun 25 '13 at 8:45
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.