my system-mutilating cleaning script
August 4, 2009 at 09:47 | Posted in Scripts | Leave a commentTags: cleaning, locate
#!/bin/sh
echo “updating slocate database…”
sudo updatedbecho “searching for and deleting instances of *.bak files…”
locate -i -r .bak$ | sed ‘s/ /\\ /g’ | sudo xargs rm -Rvecho “searching for and deleting instances of *.*~ files…”
locate -r ~$ | echo
# (I added this step because it would delete files like “~Final Fantasy VIII~” as well T_T)
read | echo “press enter to continue and delete files listed above”
locate -r ~$ | sed ‘s/ /\\ /g’ | sudo xargs rm -Rvecho “removing all found instances of Thumbs.db…”
locate -r /Thumbs.db$ | sed ‘s/ /\\ /g’ | sudo xargs rm -Rvecho “deleting contents of trash…”
sudo rm -Rv /home/susie/.local/share/Trash
sudo rm -Rv /root/.local/share/Trashecho “removing thumbnail cache…”
sudo rm -Rv /home/susie/.thumbnails
sudo rm -Rv /root/.thumbnailsecho “removing .serverauth files…”
sudo rm -Rv /home/susie/.serverauth*echo “deleting temporary files…”
echo “(note: will cause some programs to work improperly this session)”
sleep 2
sudo rm -Rv /tmp/*echo “re-updating slocate database…”
sudo updatedbecho “finished.”
exit
edit — Actually, I just read here that the .serverauth files can be prevented altogether.
how long updatedb really takes
November 23, 2008 at 12:13 | Posted in Uncategorized | Leave a commentTags: locate, updatedb
To index root, my external, and windows,
# time { updatedb; }
real 4m32.002s
user 0m1.244s
sys 0m6.032s
Four and a half minutes. Seems like ages.
Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.