Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

find command is misbehaving on debian

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
s.sh
Posts: 8
Joined: 2017-01-20 18:36

find command is misbehaving on debian

#1 Post by s.sh »

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

User avatar
pylkko
Posts: 1802
Joined: 2014-11-06 19:02

Re: find command is misbehaving on debian

#2 Post by pylkko »

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?

s.sh
Posts: 8
Joined: 2017-01-20 18:36

Re: find command is misbehaving on debian

#3 Post by s.sh »

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

Post Reply