Short form of directory, and of direction. A named abbreviation rather than a concept.
Latin directus, past participle of dirigere, dis- (apart) plus regere (to guide, keep straight); dir is the modern clipping used for both a directory and a direction.
A named place in a structure, or the bearing a thing points along — the same short word standing in for either sense depending on where it is used.