find command is misbehaving on debian

If none of the more specific forums is the right place to ask

find command is misbehaving on debian

Postby s.sh » 2017-06-30 06:39

Searching for system-resolved service following the recent vulnerability disclosure, I came to see a very strange behavior from find command.

Code: Select all
 root@localhost:/# find . -name "*systemd-resolved*"
./usr/share/man/man8/systemd-resolved.service.8.gz
./usr/share/man/man8/systemd-resolved.8.gz



The command returns 0 or two results like above. But if I run the command the second time I get:

Code: Select all
root@localhost:/# find . -name "*systemd-resolved*"
./usr/share/man/man8/systemd-resolved.service.8.gz
./usr/share/man/man8/systemd-resolved.8.gz
./lib/systemd/systemd-resolved
./lib/systemd/system/systemd-resolved.service.d
./lib/systemd/system/systemd-resolved.service


This means the first time, "find" does not actually find everything. Also this only happens one time. Running the command next times shows correct output. I checked this on some other systems with Debian OS installed. On those with Kernel 4.9+ this exact problem always occurs but on systems with kernel 3.16 it doesn't happen. Can anybody explain what's going on here?
Note: I did not check other distros
s.sh
 
Posts: 8
Joined: 2017-01-20 18:36

Re: find command is misbehaving on debian

Postby pylkko » 2017-06-30 06:57

I don't know but IIRC this was posted by another user some time ago, this same problem that is, that find would work differently on the first time. I believe that in that case also the user was using a search string that had characters that needed to be "interpreted" by the shell (like * and ")

Are all the files that it finds on the second time sym links?
User avatar
pylkko
 
Posts: 1042
Joined: 2014-11-06 19:02

Re: find command is misbehaving on debian

Postby s.sh » 2017-06-30 07:11

pylkko wrote:Are all the files that it finds on the second time sym links?


No they are not. Only one of the files among all is a symlink. systemd-resolved.8.gz is a link to systemd-resolved.service.8.gz
s.sh
 
Posts: 8
Joined: 2017-01-20 18:36


Return to General Questions

Who is online

Users browsing this forum: No registered users and 8 guests

fashionable