How to find files excluding symbolic links?

前端 未结 6 1486
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-02 05:14

I want to find files in Linux that follow a certain pattern but I am not interested in symbolic links.

There doesn\'t seem to be an option to the find comm

6条回答
  •  [愿得一人]
    2021-02-02 05:34

    Do you want it to follow symlinks but not return them (if they match your pattern)?

    find -H?

    man find
         ...
         -H      Cause the file information and file type (see stat(2)) returned for each symbolic link specified on the command line to be those of
                 the file referenced by the link, not the link itself.  If the referenced file does not exist, the file information and type will be
                 for the link itself.  File information of all symbolic links not on the command line is that of the link itself.
    
         -L      Cause the file information and file type (see stat(2)) returned for each symbolic link to be those of the file referenced by the
                 link, not the link itself.  If the referenced file does not exist, the file information and type will be for the link itself.
    
                 This option is equivalent to the deprecated -follow primary.
    

提交回复
热议问题