Skip to content

Instantly share code, notes, and snippets.

@D1360-64RC14
Last active June 8, 2023 16:55
Show Gist options
  • Save D1360-64RC14/abab9bd8a036f499e0f956e0d6196153 to your computer and use it in GitHub Desktop.
Save D1360-64RC14/abab9bd8a036f499e0f956e0d6196153 to your computer and use it in GitHub Desktop.
Put every /opt/*/bin into PATH. The bash code should be placed at the end of your ~/.bashrc file (or similar). Supports also symbolic links to bin or complete folders.
# Put every /opt/*/bin into PATH
OPT_BINS=$(find /opt/*/bin -maxdepth 0 -type d,l 2> /dev/null)
PATH_OPT_BINS=$(echo $OPT_BINS | sed 's/ \//:\//g')
export PATH=$PATH:$PATH_OPT_BINS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment