# How do you organize your home directory?



## Agi93 (Feb 17, 2010)

I am reorganizing my home directory and would like to see what other FreeBSD-ers like to do. I'm curious about setting it up much like the '/' directory, but I'm not sure if that system will even work since they are laid out for totally different purposes.

One thing I really hate on Windows or Mac OS X is that directories are laid out for you in '~/' and you really cannot remove and rename them without messing some things up. I'm talking about having the "standard" Desktop, Documents, Downloads, Movies, Music, Pictures, etc.

I'm also thinking of keeping a text file called HIER in my '~/' which explains the purpose of each subdirectory (mainly so I don't forget). Here's what I've been thinking up so far:


```
/usr/home/agi/HIER
Layout of directories within agi's $HOME

art/    Location for the storage of multimedia files.  All multimedia is a form
        of art, hence the directory's name.

    sounds/     Music and other sound files.
    images/     Wallpapers, personal photos, etc.
    movies/     Video files.

bin/   Personal scripts.  ~/bin is in the $PATH.  Periodic scripts get their own 
       entry in the crontab.

etc/    For storage of valuable configuration files, such as that of a 
        customized kernel and any other dotfiles within the home directory in 
	which a lot of time and care has been invested.  Those files should be 
	symlinked to the home directory while actually stored here.

opt/    Miscellaneous files that do not belong in the other directories.

transfer/   Downloads from web browsers, ftp applications, and bittorrent
            clients begin here.  These files are sorted after the transfer has
            been completed. NOTE: THINK OF A SHORTER (3-5 LETTERS) AND WITTER 
	    DIRECTORY NAME FOR DOWNLOADS

var/    Variable files, that is, files that change in size or presence
        relatively frequently.

    build/  Source code and build files are stored and processed here.  Each
            package to be built gets its own subdirectory with the same name as
            the package.

    text/   Human-readable documents of type .txt, .tex, or with no extension.
            Each TeX document gets its own subdirectory with the same name as
            the file.  This is automatically created by the vl and vx scripts
            found in ~/bin.

            tpl/    Contains TeX templates.
	    class/  Each school class gets its own subdirectory within this one
		    for archived assignments.

    tmp/    A directory for temporary files just in case I need one in the home
	    directory NOTE: CONSIDER RENAMING TO nonsense/ JUST FOR FUN

    wiki/   Zim wiki notes are kept in here.
```

This most likely doesn't follow standard UNIX directory hierarchy tradition, so if someone could link to the standards for that, it would be great. I'm considering following those as strictly as possible unless that just doesn't work for me, in which case I'll either fall back to documents/ downloads/ images/ or use this strange hybrid above.

So how do you guys do it? What works for you?


----------



## phoenix (Feb 17, 2010)

There are no standards for $HOME.  It's your personal space, do what you want with it.  

Mine is:

Documents
Downloads
Temp
scripts
Projects
Music
Movies


----------



## lesha (Feb 17, 2010)

I usually make /home as separate partition on harddisk.
It works with greater speed by separate call to disk sectors.


----------



## graudeejs (Feb 17, 2010)

bin
devel
doc
mnt
pic

most other stuff I put in
/files/*/*

where /files/* is separated zfs filesystem with different options (for example /files/archive has copies=3)


----------



## lesha (Feb 17, 2010)

In other things I agree with Agi93, but
separate /home does not require going through the symlink.


----------



## ckester (Feb 17, 2010)

> transfer/   Downloads from web browsers, ftp applications, and bittorrent
> clients begin here.  These files are sorted after the transfer has
> been completed. NOTE: THINK OF A SHORTER (3-5 LETTERS) AND WITTER
> DIRECTORY NAME FOR DOWNLOADS



How about "xfr"?  It's a common three-letter acronym for "transfer".

And instead of killasmurf86's "devel" as a place to put all my software development projects, I use "src".


----------



## ckester (Feb 17, 2010)

Also:

pix - pictures
flix - movies
snd - music and other audio files

and the usual

tmp
man
doc
bin
lib

But of course this lovely brevity can't be sustained when various apps create their own directories to hold user settings and stuff.  If we insisted on agi93's scheme, we should force them to put their stuff under ~/etc, but that's probably more trouble than it's worth.


----------



## graudeejs (Feb 17, 2010)

ckester said:
			
		

> And instead of killasmurf86's "devel" as a place to put all my software development projects, I use "src".



Heck, why didn't I though of that


----------



## oliverh (Feb 17, 2010)

>How do you organize your home directory?

Like my real desktop, it's a very personal thing, a matter of taste and consequence.


----------



## avilla@ (Feb 17, 2010)

i use to be very verbose with naming conventions, and to prefer deep hierarchies of directories containing few files. this makes easier to find files, but a bit longer to access them. since i have tons of files, though, i like this way

i have some generic directories, but when some topic gets its size, it gains its own hierarchy 
an example:

```
business
camera (photos and video recordings)
development
|-- operating_systems
|   |-- documents
|   |-- projects
|   |   |-- ***
|   |   `-- freebsd
|   |       |-- ***
|   |       `-- ports (and so on)
|   `-- tests
`-- www
misc (this is the hierarchy i try to replicate in every other directory)
|-- audio
|-- documents
|-- fonts
|-- images
|-- models (3d stuff)
|-- software
`-- video
mobile_phone
music
pocket_pc
school
star_wars (example of a topic that gained its own hierarchy)
```

and ~/ is the temporary directory for downloads and generic stuff


----------



## Oxyd (Feb 17, 2010)

I use the same organization as I use on my desk: None.  It's just some chaotic hierarchy of files that I'm too used to to change. 

And I place temporary stuff like downloads and others, into /tmp -- my ~/ is only for things that I want to keep.


----------



## Matty (Feb 17, 2010)

Oxyd said:
			
		

> I use the same organization as I use on my desk: None.  It's just some chaotic hierarchy of files that I'm too used to to change.
> 
> And I place temporary stuff like downloads and others, into /tmp -- my ~/ is only for things that I want to keep.



That's why I love apples spotlight because I dump everything on the desktop or in download. :r


----------



## Ruler2112 (Feb 17, 2010)

xzhayon said:
			
		

> i use to be very verbose with naming conventions, and to prefer deep hierarchies of directories containing few files. this makes easier to find files, but a bit longer to access them. since i have tons of files, though, i like this way



It's my opinion that the more files you have, the more you'll like this type of structure and the more directories you'll want to keep things easy to find.  If you have few files, all it does is get in the way.  Whatever you do, YOU should be the one creating it, as that's the only way it'll make sense to the person using it.

Look at it this way - if you have a half dozen files, there's no point in creating directories to categorize things.  (I started out similar to this - just threw everything in my home directory.)  After a while, I got too much stuff in there and created Documents and Downloads and sifted through my home directory to sort everything.  Documents then grew out of control, so I created further subdirectories (one for each store I take care of, one for personal stuff, another for accounting files, etc) under that one.  Then my home directory grew too big again and I created Programs to hold scripts and apps I'd written, then I sifted appropriate files out of my home directory into that one.  Things continued in this manner until I ended up with my present conglomeration.


----------



## LateNiteTV (Feb 17, 2010)

doc
images
music
movies -> /mnt/disk
music
dl
themes
code
crap


----------



## roddierod (Feb 17, 2010)

Mine is like this - but in even more detail then I care to type out.


```
Docs
  Reference
  Personal
    Banking
    Resumes
    Tax
  Stories
  Books
  Receipts

Download
   APPS
   Docs
   Images
   Torrents

Images
   PhotoImports <-- From my Camera
   Backgrounds
   Pics <-- Organized Photo Albums


Projects
   Scripts
     Python
     sh
   C
   WWW

bin
tmp
```

I keep multimedia such as mp3s and Divx on a separate drive of it own and have the directories as the genre names such as


```
AUDIO
  PUNK
    Artist Name
     Album Name
  CLASSICAL
    Artist Name
     Album Name

VIDEO
  TV
  Documentary
  Drama
```


----------



## vermaden (Feb 17, 2010)

```
download
tmp
f1 [formula 1 races and similar (gp2/wrc/...)]
gfx/wallpapers
gfx/misc
scripts (included in ${PATH})
website
movie
misc
misc/x11
misc/${OS} {freebsd/linux/solaris/...) (usefull hostos/info)
misc/sys/$( uname )/${CONFIG_FILES} (dirs: etc boot ...)
misc/${RANDOM_FILES} (a lot of info about everything)
misc/man (file) place to store useful one liners)
misc/books
```

... yes, [CMD=""]misc[/CMD] growed a little too big


----------



## fronclynne (Feb 17, 2010)

complete chaos.  I create subdirectories and move stuff into them when [cmd=""]ls[/cmd] starts giving me more than around 20 lines.


----------



## anomie (Feb 18, 2010)

I've always used: 

 /home/work-stuff : take a guess. 
 /home/misc : everything personal, including financial, music, contact info, etc.

Now, those two subdirectories each contain their own little hierarchical structures (that I seem to reorganize every couple years). But "home" stays clean.


----------



## Agi93 (Feb 18, 2010)

These are all really cool ideas! It's interesting to see how people around here organize as verbosely as xzhayon to throwing all the files together like fonclynne. 

Right now I'm thinking of something like:


```
art/    Multimedia is art, right?
    images/
    movies/
    sounds/

bin/    Personal scripts and other executables.

etc/    Valuable configuration files (ones I've put a lot of time and effort
        into).

opt/    This is basically for any file that just doesn't fit anywhere else here.

ref/    I just realized sometimes I like to download class notes, articles, and
        other PDF files that don't really change much, so they don't belong in
        ~/var/text.  This content could pretty much be read-only, so I gave it
        its own directory.  I would probably have called it ~/lib for `library'
        if /lib didn't mean something really different.

var/
    devel/  I liked the word `devel' more than `build' or `src', so I changed
            the name to that.
    text/
        tpl/    .tex templates
        class/  For classwork
    tmp/    Garbage, testing, etc.  I'm going to learn about jails soon to see
            if I can either isolate this directory or just use a jail for 
            testing scripts and stuff.
    wiki/   I love Zim-Wiki!

xfr/    Transfers from web browsers, bittorrent, ftp, and other
        internet-connected applications.
```

I like killasmurf's idea of putting a mnt directory in $HOME. Sometimes I just want to mount a flash drive and copy some files without worrying about permissions getting screwed up by using the root account. Is that pretty much how you use it, killasmurf?

And ckester, I know MirOS BSD forces all software (base system and third party) to put configuration files in ~/.etc, so it's not impossible. I've never used the OS, so I don't know how well that works.

BTW, does anyone know what the point of the /private directory in Mac OS X and iPhone OS is for? /var, /tmp, and /etc are symlinks to /private/[var,tmp,etc], respectively. What exactly does this accomplish? The man hier page is for some really old BSD version that doesn't even apply to OS X's hierarchy.


----------



## ckester (Feb 18, 2010)

I definitely need to add LateNiteTV's "crap" directory to my setup!


----------



## Agi93 (Feb 18, 2010)

I just came up with another idea to simplify the top of my ~/. One directory, store, is for files that don't change much and might as well be read only for the most part. Think of it like an archive. The other, var, is for files that change in size or presence much more often, like projects I'm working on, downloads, and temporary files. I've also renamed ref/ to doc/. The ambiguity that might have been caused by the existence of ~/var/text is mitigated by doc/ being in ~/store (showing it's for PDFs, documentation, archived documents and notes, etc.).

It looks like this:


```
store/
    bin/
    doc/
    etc/
    img/
    mov/
    snd/
    
var/
    devel/
    text/
        tpl/
        class/
    tmp/
    wiki/
    xfr/
```

This just seems to make a lot of sense to me somehow, so I'll probably end up using this scheme.


----------



## wonslung (Feb 23, 2010)

Pr0n/
Pr0n2/


----------



## Agi93 (Feb 23, 2010)

wonslung said:
			
		

> Pr0n/
> Pr0n2/



lol


----------



## ckester (Feb 23, 2010)

I don't see the need for your "store" hierarchy, since I would tend to assume that anything outside of "var" is less volatile.

But if I did see a need for it, I think I might call it "const" instead, to better evoke the idea that it contains stuff that shouldn't be changing very often.   It's also the antonym of "var".

Or maybe I'd draw an analogy from physics and set up directories called solid, liquid and gas.  Would a temp directory be plasma?    

ice, water and steam might be fun names too.

I can see how having directories like that might make incremental backups easier.


----------



## Agi93 (Feb 23, 2010)

Good point. I was thinking the same, for store/ seems to just take extra typing for no real gain in organization.

One time I saw someone who had something like this:

clinic/ for *.doc
pantry/ for *.jar
lumber/ for *.log
etc.

I thought that was creative 

Here, I moved some directories to vault/, meaning they're deposited/archived there. I think I was thinking of an archive of some sort for store/, since projects I'm currently working on go in var/

```
bin/
etc/
var/
	devel/
	text/
		tpl/
		class/
	tmp/
	wiki/
vault/
	doc/
	img/
	mov/
	snd/
xfr/
```


----------



## Ruler2112 (Feb 23, 2010)

ckester said:
			
		

> ice, water and steam might be fun names too.



vapor would be faster to type than steam because the letters are spaced between your hands.    (Also more scientifically correct IMO - steam is vaporized H20, whereas vapor is any liquid in gaseous form.)

Either way, I think I'll stick with categorization based on file type and/or class rather than how often it's changed.  I wouldn't want to have to look in multiple places to find something.  I know it's a spreadsheet done for the general manager at store x, I look in Docs/StoreX/ForOthers/GM_Name/ and then look at the directory names under that - YYYY-MM-DD_ProjectName so that they stay in chronological order and yet are descriptive at the same time.


----------



## ckester (Feb 24, 2010)

Funny, my first draft of that post had vapor instead of steam.  I changed it because it sounded a bit pretentious next to the good old Anglo-Saxon words ice and water.

Anyway, I'm not very keen on a hierarchy based on volatility or solidity.   My snd and flix directories might be more liquid than Agi93's, as I download new music or podcasts on a daily basis.   In fact, they change more frequently than any of my src directories.  But I wouldn't move them into a var directory because of that.

The reason the canonical system hierarchy separates volatile from constant or relatively non-volatile is because those are often placed on different drives or slices, with different permissions, backup strategies, etc.    

Someone mentioned that they keep their multimedia files on a separate drive; I can see how that might help improve playback performance, since the drive wouldn't need to interleave seeks related to other tasks.


----------



## Agi93 (Feb 24, 2010)

ckester said:
			
		

> Anyway, I'm not very keen on a hierarchy based on volatility or solidity.
> 
> The reason the canonical system hierarchy separates volatile from constant or relatively non-volatile is because those are often placed on different drives or slices, with different permissions, backup strategies, etc.



Yes, now I see there's really no point to do this in my home directory. Anyway, after using my Mac for the past couple of hours, here's what I have in mind:


```
Development/	for all personal scripts and software builds
	Compilation/	builds
	Executables/	scripts
Library/	archive of valuable configuration files, human-readable 
		documents, templates, and other reference-like things
	Configuration/	valuable configuration files
	Reference/	human-readable documents
	Templates/	.tex and other format templates
Multimedia/	self-explanatory
	Images/
	Movies/
	Sounds/
Text/		much like Documents/ on other systems
	Classwork/	has subdirectories for each class I'm in, which each 
			contain assignments for the respective class
	Wiki/		zim wiki files
```

I started wondering why Windows and Mac directories are like they are, and it seems its because they are simple and easy to understand. People using free operating systems almost always deviate from the Windows way, so I figure that must be because of how annoying it is to have "My Documents", in which "My Pictures", "My Movies", etc. are located. Looking back at my Mac, I realize that directories seem to almost always be one word, making it easy to type in a terminal, and the names are easy to understand (figure out). There also seems to be a distinct separation between directories intended for user interaction and those hidden and reserved for the system. The former always start with capital letters and have more meaningful names, unlike /usr, /var, /etc, and the like.

Since /home/user is my own little space and is undoubtedly intended for user interaction, I thought I should follow suit. This system seems to work well and make sense to me, and there are only four major directories in ~/ this way.

You may notice the absence of ~/xfr or ~/Transfers or whatever, and that is because I plan to set the download directory to ~/. I always deal with downloads as soon as they come, so this seems perfect. Anything important would simply be copied to the appropriate directory.


I'm probably spending WAY too much time on this, but getting my home directory just right has been driving me crazy!


----------



## ckester (Feb 24, 2010)

Agi93 said:
			
		

> Y
> I'm probably spending WAY too much time on this, but getting my home directory just right has been driving me crazy!



Not to worry.  This might seem to be a trivial exercise, but trying to get everything "just right" is a good habit to get into.  Many of the problems that people encounter with computers comes from inattention to detail or a lack of sensitivity to aesthetics.  

I don't know about everyone else, but I use BSD because it's the most elegant thing I've ever found in computing.  (Well, maybe except for Plan 9... )  

So I see nothing to laugh at in wanting to have that elegance reflected even in such seemingly simple things like the arrangement of a home directory.  On the contrary, I applaud you for your efforts!


----------



## grodzix (Feb 27, 2010)

Oh, I just love having everything organised so I know where everything is and ever ever have to use search. My current hierarchy has evolved slowly over time and it looks something like this:


```
~/data+2d_graphics (various gimp stuff)
      +3d_models+ (various blender stuff)
      |         +model01
      |         +model02
      +audio+radio (playlists for internet streaming)
      |     +ringtones (for my mobile)
      |     +various (uncategorised)
      |     +music+artist_01+album01
      |           |         +album02
      |           +artist_02+album01
      |                     +album02
      +downloads(stuff from net and random mess)
      +emu+
      |   +dos
      |   +nes
      |   +snes
      |   +n64
      |   +psx
      +images+photos+place_01+year_01
      |      |               +year_02
      |      +wallpapers+res_01
      |      |          +res_02
      |      +various (uncategorised, usually some funny photos)
      +programming+graphics
      |           +games
      |           +freebsd
      |           +various
      |           +web
      +hardware+project_01
      |        +project_02
      +video+movies
      |     +series
      |     +various
      |     +streaming (like net radios)
      |     +trailers
      +text+books+author_01
           |     +author_02
           +software+
lang_c
                    +lang_c++
                    +lang_python
                    +lib_sdl
                    +lib_opengl
                    +os_freebsd
                    +os_win
            +
```


----------



## grodzix (Feb 27, 2010)

Oh snap, I've pressed something and my message got sent before I finished writing it.

Anyway, that's more-or-less how I organise my data directory. Because I keep all my stuff in ~/data instead of in ~/ I can back up my stuff and manage is more easily as it doesn't get messed up with automatically created files in ~/ (mainly dot files).

Because I like to manage all my files myself I hate it when some smart ass program tries to do it for me creating and changing files as it wish (mainly happens on windows).


----------



## trev (Feb 28, 2010)

Agi93 said:
			
		

> So how do you guys do it? What works for you?



user

bin
work
source
tmp

root

kernels
ports
source


----------



## cromwellot (Mar 23, 2010)

*viewing the whole hierarchy of your system*

Im new to BSD. New to any command line style OS (exception (winxp internal terminal))
I was wondering if there is a command that shows all of the os's hierarchy the
way you run the sysinstalled to your disk. I cant figure bsd out.
and why is this symbol sometimes ~/ and sometimes /? 
Have searched Google trying to find any subject on the viewing of your own machines hierarchy. Thanks.


----------



## fronclynne (Mar 23, 2010)

cromwellot said:
			
		

> Im new to BSD. New to any command line style OS (exception (winxp internal terminal))
> I was wondering if there is a command that shows all of the os's hierarchy the
> way you run the sysinstalled to your disk. I cant figure bsd out.
> and why is this symbol sometimes ~/ and sometimes /?
> Have searched Google trying to find any subject on the viewing of your own machines hierarchy. Thanks.



hier(7) is helpful.  The / serves as a directory delimiter/separator (just like \ on DOS systems).  A naked / means your root directory (as in what you see when you type [cmd=""]ls /[/cmd]), any pathname beginning with / is absolute (QV).  ~/ is shorthand for your $HOME directory, that is your working directory (QV) when you first log in.  You can change to it with any one of [cmd=""]cd ~/[/cmd], [cmd=""]cd $HOME[/cmd], or (in most implementations) [cmd=""]cd[/cmd] by itself.  builtin(1) covers a lot of ground (including [red]cd[/red]).


----------



## cromwellot (Mar 23, 2010)

Also I want to find out how do you see how much used disk space and free disk space you have.


----------



## cromwellot (Mar 23, 2010)

This manual page documents the default FreeBSD file system layout, but
     the actual hierarchy on a given system is defined at the system adminis-
     trator's discretion.  A well-maintained installation will include a cus-
     tomized version of this document.
But it doesnt show my own installation on my disk. Its for example information purpose


----------



## avilla@ (Mar 23, 2010)

for the hierarchy: sysutils/tree. just run `# pkg_add -r tree`, then `$ rehash` and `$ tree / | less`

for the disk space: `$ df -h`


----------

