linux - 'find' (command) finds nothing with -wholename -
why command work:
/home/user1/tmp $ find ./../.. -wholename '.*/tmp/file.c' -exec echo '{}' \; ./../../user2/tmp/file.c /home/user1/tmp $ and command not work? (finds nothing)
/home/user1/tmp $ find /home -wholename '.*/tmp/file.c' -exec echo '{}' \; /home/user1/tmp $
the first command generates file names starting ./../... wholename pattern match because start ..
the second command generates filenames starting /home. however, wholename pattern still looking paths starting . not match file in case.
note patterns not regular expressions. if expecting them, @ -regex option instead.
Comments
Post a Comment