I was querrying a server using a command like this:
find ./ -type f -name 'filename"
I got many files starting with
What do these things mean?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
It doesn't mean much: the pattern that you gave
./, 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.
find - find files (POSIX)
findutility shall recursively descend the directory hierarchy from each file specified by path, evaluating a Boolean expression composed of the primaries described in the OPERANDS section for each file encountered. Each path operand shall be evaluated unaltered as it was provided, including all trailing
<slash>characters; all pathnames for other files encountered in the hierarchy shall consist of the concatenation of the current path operand, a
<slash>if the current path operand did not end in one, and the filename relative to the path operand. The relative portion shall contain no dot or dot-dot components, no trailing
<slash>characters, and only single characters between pathname components.
.// means current directory, so
.//user in the output indicates file
user in the current working directory.
// should resolve to a single
/, this is true for all systems I've used. Although, POSIX only defines this behavior only for
/// (or more), and of course
// appears because you've used the search path for
./, instead of the typical
.. Both indicates current working directory, and both are correct. This is
find's behavior to append the path in that manner in case of relative paths. Note that, this specific behavior of
find is prevalent in only a subset of systems as this answer mentioned, and you one is presumably one of them.
.// is the same as
Successive slashes beyond the first have no semantic meaning.