Is it a good practice to create a folder in /?
I'm currently working on a project where some install script of some other teams are creating a lot of files/scripts and others various stuff in a folder located in /
. eg: /installfolder
Is that considered bad practice ? Wouldn't be better to store everything in /opt/lovelyfolder
instead ?
Solution 1:
That would not be in line with the Filesystem Hierarchy Standard:
There are several reasons why creating a new subdirectory of the root filesystem is prohibited:
- It demands space on a root partition which the system administrator may want kept small and simple for either performance or security reasons.
- It evades whatever discipline the system administrator may have set up for distributing standard file hierarchies across mountable volumes.
Distributions should not create new directories in the root hierarchy without extremely careful consideration of the consequences including for application portability.
The correct place for add-on applications is /opt/<provider>
:
/opt is reserved for the installation of add-on application software packages.
A package to be installed in /opt must locate its static files in a separate /opt/ or /opt/ directory tree, where is a name that describes the software package and is the provider's LANANA registered name.