upvote
Looks dangerous to put a user writable directory ahead of system directories in PATH
reply
Nah, it's totally normal because you often want to deliberately override or wrap system commands for various good and convenient reasons.

If your concern is that some hacker could put an illicit binary in ~/.local/bin, then your security problems are much deeper than your PATH order.

reply
While we're all getting pedantic and esoteric, in zsh you can do this:

path+=(~/.local/bin)

You don't even have to use the "export" keyword. Not that I would do this, but since we're all pointing out random shell stuff...

(In zsh the lowercase "path" variable is an array that's automatically tied to the $PATH string, so you can just add to it using parens to signify new array elements, separated by a space.)

reply