What does dot forward slash forward slash mean (.//)

command linefilenamesfindslash

I was querrying a server using a command like this:

find ./ -type f -name 'filename"

I got many files starting with

.//library 

or

.//user

What do these things mean?

Best Answer

It doesn't mean much: the pattern that you gave find was ./, and it is simple for find to glue its results onto that path. A double-slash is ignored (treated as a single slash) except that a leading double-slash could have some meaning for some systems. More important, portable programs assume this behavior.

However, you will see this particular behavior only for BSD-derived systems with an old version of find (OSX for example). NetBSD attempted to fix this in their source in 2005; the userland for OSX is older.

Checking "recent" FreeBSD, NetBSD and OpenBSD, none produce this behavior. Linux and Unix (AIX, HPUX, Solaris) likewise do not.

Further reading:

Related Question