c33*_*33s 35
我得到的信息:
/usr/local/sbin custom script meant for root
/usr/local/bin custom script meant for all users including non-root
Run Code Online (Sandbox Code Playgroud)
聊天记录来自irc.debian.org #debian:
(02:48:49) c33s: question: where is the _correct_ location, to put custom scripts
for the root user (like a script on a webserver for createing everything needed
for a new webuser)? is it /bin, /usr/local/bin,...? /usr/local/scripts is
mentioned in (*link to this page*)
(02:49:15) Hydroxide: c33s: typically /usr/local/sbin
(02:49:27) Hydroxide: c33s: no idea what /usr/local/scripts would be
(02:49:32) Hydroxide: it's nonstandard
(02:49:53) Hydroxide: if it's a custom script meant for all users including
non-root, then /usr/local/bin
(02:52:43) Hydroxide: c33s: Debian follows the Filesystem Hierarchy Standard,
with a very small number of exceptions, which is online in several formats at
http://www.pathname.com/fhs/ (also linked from http://www.debian.org/devel/ and
separately online at http://www.debian.org/doc/packaging-manuals/fhs/fhs-2.3.html)
(02:53:03) Hydroxide: c33s: if you have the debian-policy package installed, it's
also in several formats at /usr/share/doc/debian-policy/fhs/ on your system
(02:53:37) Hydroxide: c33s: most linux distributions follow that standard, though
usually less strictly and with more deviations than Debian.
Run Code Online (Sandbox Code Playgroud)
谢谢你前往Hydroxide
Mat*_*inn 19
如果您正在讨论将由该用户crontab运行的用户创建的脚本,我通常将它们放在主目录中的bin或scripts文件夹中,或者如果它们打算在用户之间共享,则/ usr/local/scripts目录.
对于它感兴趣的人,文件系统层次标准(FHS)是一个标准文档,仍然是一个非常好的阅读.我描述了几乎所有Linux发行版的基础,并且正式得到Debian和Linux Standards Base(LSB)的认可.
但是,你找不到任何肯定的答案,因为......它没有定义;-).我只能说:不要放入/ bin(既不在/ usr/bin中)./ usr/local/scripts也很不寻常.$ HOME/bin似乎是一个可接受的地方,如果该脚本仅由该单个用户使用.