Missing commands in /usr/bin

Hello,

I’ve noticed that inside the snap environment (snap run --shell ) there are many files in /usr/bin and /usr/sbin that seem to be missing, compared to being outside the environment.

From my snap, I’m trying to exec of these executables (the specific one is smartctl) but it isn’t there. How can I get access to this file? Is there a blacklist/whitelist or something that is filtering the files that the snap sees in /usr/bin and /usr/sbin?

Thanks in advance,

Inside a non-classic snap’s execution environment (into which you enter when using snap run --shell), most of the rootfs you see comes from the core snap, not the host system. That explains the discrepancy you notice. From your host, take a look in /snap/core/current/usr/bin and it should look familiar.

Thanks Kyrofa!

Follow up question: is it possible to get access to an executable in
/usr/bin from a non-classic snap? Or should I just include the executable
in my snap?

typically you do the latter …