Ask HN: How do you organize your home directory? - zingplex
======
lholden
I generally embrace the standard home directory structure. ~/Downloads,
~/Documents, etc. I always have a ~/Projects directory that I keep my source
code for various projects I am working on. (Or non source code projects that
are not just a document of some sort).

Applications I install for my user go under ~/.local. So ie, ~/.local/bin for
just a binary or ~/.local/appname for something specific with a symlink to
~/.local/bin.

I use a simple user cron job to clear out files older than 3 days from my
Downloads folder so that it doesn't become messy.

I keep my bash profile in git and will check it out to ~/.bash and symlink the
appropriate files where I want them from there.

Same for Vim.. but ya know... ~/.vim ;).

------
orcs
I have my 'home directory' on a separate drive to the system drive which I
simlink to from the home directory in the system drive. It means I can install
OS's anytime without touching my files. I symlink to some dot files too. Once
I learn bash better I will automate it like I have with reinstalling all my
favourite programs.

------
frou_dh
All my stuff goes in a homegrown directory hierarchy under $HOME/workspace/

The reason I avoid making use of the OS's default subdirectories of $HOME is
that I don't like "my" files becoming intermixed with stuff that applications
decide to silently poop out to well-known locations on disk.

~~~
oftenwrong
That is a brilliant tip! I am doing this from now on. It says something about
the state of $HOME pollution that users would choose to "move out".

------
oftenwrong
Pretty broad question. One thing I suggest: Do not keep downloads in your home
directory. Keep them in a directory under /tmp. This avoids accumulation of
download clutter.

~~~
wingerlang
I use Hazel to continuously trim downloads. Every time a file is 14 days old
it is moved into a 'review' folder and I get a notification about it. This
gives me a steady stream of old files to either delete or move into a proper
folder.

Sure I could do it in the download folder directly as well, but in reality I
had to go through 100s of files every few months which can be annoying.

I wrote about it a few years ago here and I do it still
[http://jontelang.com/blog/2015/08/17/hazel-is-
great.html](http://jontelang.com/blog/2015/08/17/hazel-is-great.html)

~~~
oftenwrong
Just for fun, I tried to do something similar with a shell script:

    
    
        set -eu
        AGE_LIMIT=$(( `date +%s` - (14 * 86400) ))
        for FILE in ~/Downloads/*
        do
    	    if [ -e "$FILE" ]
    	    then
    		    export `stat -s "$FILE"`
    		    if [ $st_birthtime -lt $AGE_LIMIT ]
    		    then
    			    mv "$FILE" "~/Needing review/"
    		    fi
    	    fi
        done
    

Run it from cron. Typical caveats of shell scripts apply!

~~~
b_rodriguez
I imagine you could instead do it like this:

    
    
      find ~/Downloads -Btime +14d -exec mv {} ~/Needing\ review \;
    

Some changes may be necessary as I am not able to test it right now

