Last month I complained about how brutal the rm program in Linux was and how I cocked things up when I wanted to remove the autosaved backup files that jed creates. Here's the solution...

I created a script in ~/bin/Mvbackupfiles that looks like this:


#!/bin/sh
mv -v *~ /tmp

Now, whenever I want to clear a directory of all files like dummy.py~ or README.txt~, I just run Mvbackupfiles and I become a much happier and tidier person.

Here's what it can look like:


peterbe@trillian:~/dev/signature_hider $ ls
index.html  index.html~
peterbe@trillian:~/dev/signature_hider $ Mvbackupfiles 
`index.html~' -> `/tmp/index.html~'
peterbe@trillian:~/dev/signature_hider $ ls
index.html

Comments

Sascha Welter

Isn't there a setting to put those backup files into /tmp in the first place?

Your email will never ever be published.

Previous:
createElement('a') with a javascript href November 21, 2005 Web development
Next:
Islington Knuckle Walk November 24, 2005 Kung Fu
Related by category:
set -ex - The most useful bash trick of the year August 31, 2014 Linux
brotli_static in Nginx November 8, 2024 Linux
Be very careful with your add_header in Nginx! You might make your site insecure February 11, 2018 Linux
Linux tip: du --max-depth=1 September 27, 2007 Linux
Related by keyword:
Jed looking like Emacs September 28, 2005 Linux
Local jed settings April 19, 2013 Linux, macOS
Wing IDE versus Jed December 11, 2008 Linux
Geeking with tags file for Jed May 29, 2006 Python, Linux