Technical article 105051

The find(C) command does not locate files by name when starting from a subdirectory.

OpenServer 6.0.0OpenServer 5.0.0OpenServer 5.0.2OpenServer 5.0.4OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7UnixWare 7.0.0UnixWare 7.0.1UnixWare 7.1.0UnixWare 7.1.1UnixWare 7.1.2UnixWare 7.1.3UnixWare 7.1.4Open UNIX 8

Written · Last revised

Problem

I am not seeing consistent behavior using the find(C) command.

In the following example, I am trying to display all files with the string: "tune" in their names that are located within the subdirectory /etc/conf:

# find /etc/conf -name \*tune\* -print

This command does not work; no files are returned.

The find(C) commands:
# find /etc/conf/. -name \*tune\* -print
# find /etc/conf/.. -name \*tune\* -print
do work; files are returned.

The find command that does not work did work under releases previous to SCO OpenServer Release 5.0.

Why does find no longer work as expected?

Cause

The find(C) command does not cross symbolic links.

Solution

One of the features of the Software Storage Objects (SSO) model is that it relies heavily on symbolic links.

The find(C) command will not cross a symbolic link unless you
specify the "follow" directive.  The /etc/conf directory
happens to be a symbolic link to the SSO subsystem directories.
# find /etc/conf -follow -name \*tune\* -print

Using the example (above) that did not work, adding "follow" to the find(C) options list will cause all files to be correctly returned.

See also

man pages for find(C), ln(C), or symlink(S).

From the Xinuos technical article database, record 105051. Reproduced with permission. The original is at www.sco.com/ta/105051, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.