is there a name for the directory that is one lower that the docroot?

rusty carruth rustycar54 at descomp.com
Tue Jan 7 22:08:24 MST 2025


Ok, possible nit pick time.  From the point of the filesystem (assuming
ext2/3/4/etc) ALL directories have a 'parent', if you define 'parent'
to mean where you end up when you say 'cd ..'.  Even '/' has a 'parent'
- itself!

For example, on my laptop:

rusty at rusty-Alienware-17-R4:~$ ls -al / |head -3
total 18260668
drwxr-xr-x  27 root  root         4096 Jan  5 17:39 .
drwxr-xr-x  27 root  root         4096 Jan  5 17:39 ..
rusty at rusty-Alienware-17-R4:~$ 
rusty at rusty-Alienware-17-R4:~$ cd /
rusty at rusty-Alienware-17-R4:/$ pwd
/
rusty at rusty-Alienware-17-R4:/$ cd .. ; pwd
/
rusty at rusty-Alienware-17-R4:/$ 

So even / has a parent directory (as defined by '..') - itself.  Side
note - I worked someplace where they used this as a feature, sort of. 
They wanted to 'look up' the directory tree for a certain directory
(without using find ;-), so their $PATH had something like
'../bin:../../bin:../../../bin:../../../../bin:../../../../../bin' in
it, so that they would 'find' the bin dir that was 'closest' upward -
and if they happened to be somewhere that one of those '../' hit '/',
it wouldn't cause an error since there is always a directory 'above'
every directory.

On Tue, 2025-01-07 at 15:00 -0700, David Schwartz via PLUG-discuss
wrote:
> 
> (Every folder except ‘/‘ has a “parent directory”.)



More information about the PLUG-discuss mailing list