It's difficult to just do things. Even windows feels more "free." Phone OSes are built like prisons.
Ideally Android would let you drop into a real shell, without having to deal with android sandboxing.
Regardless, I use termux and tasker to get my automations done.
It's a pretty big sandbox in my experience.
How easy it is to do an equivalent thing on Android?
The neat thing about non-Android phones with respect to what you mention is that you can do those things just like how you would on any other computer, without having to worry about Android workarounds that may one day stop working via an update.