shell

Deleting files to the trash in the shell

Somebody on Ubuntu brainstorm wanted to have rm throw files into the trash. This is not really a good idea, because it will probably end up confusing you when you start using SSH to other machines or try the same thing at your neighbors new Ubuntu installation.

The solution is the following:
1) Open a terminal
2) Run the command:

echo alias del=gvfs-trash >> ~/.bashrc

Remove 30 day old files from you GNOME trash

This was written and tested on Ubuntu 8.04 beta4

Removing 30 day old files from you gnome trash can be done with the following magic line:

find ~/.local/share/Trash/files/ -type f -mtime +30 -printf '%P\000'  |xargs -n1 -I {} -0 gvfs-rm trash:///_{}

Now, what if you want to do this every day? Simple: add a crontab entry to do it all: run crontab -e and insert the following:
# m h  dom mon dow   command
MAILTO=""
@daily find ~/.local/share/Trash/files/ -type f -mtime +30 -printf '%P\000'  |xargs -n1 -I {} -0 gvfs-rm trash:///_{}

Download more of The Daily Show then you can look at

The Daily Show can be viewed online. Most pieces of the program are online, and appart from having more ad space, I can't see why they split up the episodes.
However, if you don't want to keep clicking, you can just download most of the early daily shows...

Show the places you logged in from

I only use a few locations to log into the shell accounts I have, so looking at whether an unfamiliar host has used logged in can help heighten security. Only the time of the last login can help me detect whether somebody has been using one of the machines I've been using to access my account without my knowledge, so it's a good idea to also show the last login with the date and time.

Syndicate content