Post #1764837
2026-04-29 02:02 UTC
"install" vs "cp":
- former sets permissions explicitly; latter inherits them
- former removes any destination files and writes a new version; latter overwrites in place (could result in corruption if interrupted mid-overwrite)
- neither preserve source mtime, so I guess they're equivalent there
So in effect:
sudo install -m 0755 script.sh /dest/binary
is functionally equivalent to
sudo cp script.sh /dest/binary && sudo chmod +x /dest/binary
TIL!
Replies (0)
No replies.