Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What do you call the opposite of the root directory in a file path, for instance:

/home/stephenm/somedir/

How would you refer to the directory

/somedir/

in a generic way and it is not the PWD does it have a certain name?

share|improve this question
    
The term root is loosely based on a tree metaphor. As such, I would consider each subdirectory to be a "branch" (and a file to be a "leaf")...though the metaphor rather breaks down in the event of symbolic links! –  Graham Wager Dec 27 '12 at 10:13
    
Thanks @GrahamWager I guess the question is, if you snap a branch off what’s the leaf at the thin end called? –  Shutupsquare Dec 27 '12 at 10:20
    
I'd say they're all just branches until you hit a leaf. I'm not even sure there's an "official" thing to call it, other than just a directory or if active the current directory... –  Graham Wager Dec 27 '12 at 10:27

2 Answers 2

up vote 2 down vote accepted

The last segment of a path is usually called the tail. The earliest use of the term that I know of was by Bill Joy in An Introduction to the C shell, page USD4:28, where he described the C shell's :t tail operator.

share|improve this answer
    
Thanks this seems the most correct to me, I will see how the votes are later and accept "the winner" as judged by the people. –  Shutupsquare Dec 27 '12 at 11:06

I don't think there is a well-known and unambiguous single-word for that.

  • You can call it the local name of the file's directory.

  • You can call it the basename of the directory path.

  • You could argue that a directory is never more than a single element of a path and therefore it is the local directory

  • You could adopt the idea mentioned in Graham's comment and call it a leaf directory

Whatever you do is likely to need some accompanying explanation or example.

share|improve this answer
1  
Seems to me that just calling it a "subdirectory" would suffice. –  martineau Dec 27 '12 at 13:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.