4 ms·
I like some of the directions you're heading with that. One thing I've thought is it might be useful to have tools that create filesystem objects (like "new" o
by linsomniac 2y ago
I like some of the directions you're heading with that. One thing I've thought is it might be useful to have tools that create filesystem objects (like "new" or "mov foo bar/") be able to take permissions. "mov --umask 027 --owner alice:bob foo bar/" and "new --mode a=rx foo/" for example.
- yjftsjthsd-h 2y agoinstall(1) does that: https://www.man7.org/linux/man-pages/man1/install.1.html https://www.man7.org/linux/man-pages/man1/install.1.html
- linsomniac 2y agoIndeed, under very limited circumstances of copying files and the man page says "-o" and "-g" only work as superuser, though I just tested it and that seems to be more a note about how chgrp()/chown() work (if you are changing to a group/user you don't have privs for), and it works in the case of a copy. Indeed very useful in some cases; I use it in CI/CD pipelines and Dockerfiles typically.
- yjftsjthsd-h 2y agoIt also works for creating directories, ex. install -d -m 755 somedir And yeah, I'm pretty sure the owner/group thing is just noting that at least on GNU/Linux that's just how the OS works (I think that varies among unix-likes).