[Courses][Linux comands] tee, file, stat, find

Meredydd meredydd at everybuddy.com
Wed Mar 10 19:53:36 EST 2004


May I butt in?

On Wednesday 10 March 2004 18:33, Katie Bechtold wrote:
> Now I have a question -- what's up with the number of links to a
> directory file?  For instance, I tried this:
*snip*
> What's going on there?  There are three links to the directory Mail,
> but "find" only finds one.
I'm willing to bet that Mail/ has two subdirectories. Each of these 
subdirectories contains a link to that directory, called ".." - that's 
how the whole "../" thing is implemented. Indeed, someone r00ting a 
system will sometimes artificially remove the .. link (you need to use 
the unlink() system call directly, cause rm will refuse to do it, but 
it can be done), then make a new directory with that name and store 
their h4xx0r t00lz there. Find won't see it, cause it ignores the "." 
and ".." entries when it lists directories - the only time you're 
likely to find it is if you run a fsck, which will complain about 
things such as inconsistent ".."s.

Meredydd


More information about the Courses mailing list