Kiedy uruchamiam findz tymi argumentami, zwraca tysiące plików:
steven@nook:/mnt/station/media $ sudo find . -not -user steven -or -not -group users | wc
3508 17479 245851
steven@nook:/mnt/station/media $
Po dodaniu -execargumentu zachowuje się, jakby findnie zwrócił żadnych wyników, a kod powrotu oznacza sukces:
steven@nook:/mnt/station/media $ sudo find . -not -user steven -or -not -group users -exec echo {} \;
steven@nook:/mnt/station/media $ echo $?
0
steven@nook:/mnt/station/media $
(Moim celem jest wykorzystanie -exec chown -v steven:users {} \;wyników (stąd sudo), ale używam -exec echo {} \;powyżej, aby lepiej zilustrować problem i wykluczyć chownjako czynnik przyczyniający się.)
Używam GNU find w magazynie Bash na Ubuntu Xenial:
steven@nook:/mnt/station/media $ find --version
find (GNU findutils) 4.7.0-git
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Eric B. Decker, James Youngman, and Kevin Dalley.
Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS(FTS_CWDFD) CBO(level=2)
steven@nook:/mnt/station/media $ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"
steven@nook:/mnt/station/media $ echo $SHELL
/bin/bash
steven@nook:/mnt/station/media $