Running Cron Job w/ Sudo permissions Strictly for learning purposes (possibly maintenance as well) I am trying to have a Cron job empty my trash once a day.

I have opened terminal and entered the command crontab -e to access the VI editor to add the command. I've entered Insert mode and added * * * * * sudo rm -rf ~/.Trash/*, hit the escape key to exit and quit VI with :wq!

This particular script I have running every minute just to see if it works and it is not. I thought it might be an issue with cron not having root access, so I added the same line to the sudo crontab -e file and it doesn't seem to be saving.

Any ideas what could be wrong with this cron job?
If you want to specify the the root user's crontab, you have to use the -u option.

sudo crontab -e -u root

That said, there's a safer way to clean out your trash than just removing the whole directory.  Personally, I like to remove files that are older than a certain number of days.  This way, if I inadvertently delete something today, I have a "buffer" of time in which to recover from.

The following command will delete all files that are older than 15 days. 

find ~/.Trash/ -type f -mtime +15 -exec rm {} \;

Now...that said...

cron has been deprecated for launchd.  I would take some time and learn how to create .plist XML files for lauchd and use that service instead of cron