Skip to content

Implement -samefile #373

Closed
Closed

Description

@hanbings

refer: https://www.gnu.org/software/findutils/manual/html_node/find_html/Hard-Links.html

Test: -samefile NAME
True if the file is a hard link to the same inode as name. 
This implies that name and the file reside on the same file system, i.e., 
they have the same device number.

Unless the ‘-L’ option is also given to follow symbolic links, 
one may confine the search to one file system by using the ‘-xdev’ option. 
This is useful because hard links cannot point outside a single file system, 
so this can cut down on needless searching.

If the ‘-L’ option is in effect, then dereferencing of symbolic links applies 
both to the name argument of the ‘-samefile’ primary and to each file examined 
during the traversal of the directory hierarchy. Therefore, ‘find -L -samefile NAME’ 
will find both hard links and symbolic links pointing to the file referenced by name.

Activity

  1. linked a pull request that will close this issuefind: Implement `-samefile` #389on May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions