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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -