Sure. This may be achieved, it really works on a program that isn’t a part of the system. It isn’t advisable for system applications. You would wish to repeat it to a vacation spot that you’ve got permission to write down to and ensure it’s in your PATH and the correct permissions assigned to it.
Generally it’s simpler to only set up a binary with the normal strategies so it is going to be put in with dependencies and or within the right PATH with right permissions and many others.
Let’s undergo the method and see the outcome.
I simply tried this on two macs. I moved traceroute from /usr/sbin to a different mac to /usr/native/bin/. It is not going to enable shifting it to /usr/sbin on the opposite mac as a result of macOS wont enable it. There have been no safety alerts or quarantine points.
Terminal command:
scp /usr/sbin/traceroute person@destination-mac:/usr/native/bin
On vacation spot mac:
chmod +x /usr/native/bin/traceroute
I then tried to execute the file:
traceroute ebay.com
Output:
zsh: killed traceroute ebay.com
So you may see that whereas it may be achieved, it’s not actually a advisable technique.
It does nevertheless work while you copy a program that isn’t a part of the system.
Create a take a look at program and put it aside as take a look at.sh:
#!/bin/bash
echo "Good day"
exit
Copy it to a different mac:
scp /path-to/take a look at.sh person@destination-mac:/usr/native/bin/
Make it executable on vacation spot mac:
chmod +x /usr/native/bin/take a look at.sh
Execute it:
take a look at.sh
Output:
Good day