Tip #310 Keeping your Home Directory Organized
Seen on http://www.splitbrain.org/blog/2008-02/27-keeping_your_home_directory_organizedHaving one temporary directory for downloads etc can quickly become a mess, so try this tip to organise by date. Put this into your .bashrc
export TD="$HOME/temp/`date +'%Y-%m-%d'`"
td(){
td=$TD
if [ ! -z "$1" ]; then
td="$HOME/temp/`date -d "$1 days" +'%Y-%m-%d'`";
fi
mkdir -p $td; cd $td
unset td
}
You'll receive a new function 'td' for making temp-dirs under $HOME/temp/ named by date. It is also possible to switch days back with 'td -[n]', i. e. 'td -3' which means '3 days back from now'.
alias aptitude at awk bash bc cal cat cd colrm comm cp csh curl cut date dd df dialog diff dirname dpkg du fc find fuser grep gs gzip history iconv kill ksh last less ln ls lsof lynx m4 md5sum mkdir mkfifo mkisofs mv mysql nc netstat openssl OSX perl ping popd ps pushd python read redirection rm scp screen sed sort ssh stat sudo svn tail tar tee test top tr uniq vim wc wget xargs