I have this software package which installs itself to /usr/local/mypackge
, with a bunch of subdirs. In bin/
I have linked code, as ELF executables, in /share/doc
I have documents, etc. Now suppose I’ve written some wrapper script(s) calling binaries from bin/
, and I want it to be part of the package. Where should it be placed?
On typical Linux systems, you find shell scripts in /usr/bin
and /usr/sbin
, same as the actual linked binaries – should I do the same? Should I create a scripts/
subdir? Something else?
1
On a typical Linux system, there are two kinds of scripts:
- Scripts that are meant to be regularly used by the end-user. For these scripts it is customary that you can’t easily tell if you are invoking a script or a ELF executable. They are located in the
/bin
,/usr/bin
or/usr/local/bin
folders and don’t have an extension to their name, just like all executables. - Internal scripts for a larger package. These scripts are typically not meant to be used by the end-user, so they are located outside the typical paths with executables, often in
/var/lib/<package>
.
Where to install your scripts depends on the category that they fall in.
2