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?
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 forfind
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:
pgsql: Remove trailing slashes from directories in find command
find - find files (POSIX)
How does Linux handle multiple consecutive path separators (/home////username///file)?
On what systems is //foo/bar different from /foo/bar?