Sujet : Re: Default PATH setting - reduce to something more sensible?
De : mail (at) *nospam* axel-reichert.de (Axel Reichert)
Groupes : comp.unix.shellDate : 21. Jan 2025, 07:52:25
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <871pwwwtee.fsf@axel-reichert.de>
References : 1 2 3 4
User-Agent : Gnus/5.13 (Gnus v5.13)
Janis Papanagnou <janis_papanagnou+
ng@hotmail.com> writes:
On 20.01.2025 09:05, Wayne wrote:
As for non-sudo PATH, you can always run:
export PATH=$(getconf PATH)
To get a minimal PATH setting guaranteed to include all POSIX
utilities.
>
Yes, this comes very close to what I was actually aiming at. In
my environment that's just /bin and /usr/bin and this is what I
typically need in my scripts (plus sometimes /usr/local/bin).
I am a late-comer to an interesting thread ...
I think that, depending on your Linux distribution, /bin and /sbin are
symbolic links to their respective /usr counterparts (in Debian there is
a "usrmerge" package to help with this transition). Also, depending on
the adherence to file hierarchy standards, there are different policies
when it comes to /opt and /usr/local (the latter here has no files, only
empty directories).
So a tidy minimalist might opt for /bin only (plus, if needed,
$HOME/bin, which is better than ~/bin, because tilde expansion is not,
AFAIK, included in POSIX) as non-root and /bin:/sbin else.
But all the sbin directories (and other clutter) would be gone. It
practically shows that these directories are unnecessary for a normal
(non-root) user.
Well, /usr/games is populated here ... (-:
Best regards
Axel