Bash script not found El Capitan I have created a Bash script that simply does ls -l.

In Mavericks and older versions of OSX I simply made a symlink to the script and put it in the /usr/bin folder (ln -s ll.sh /usr/bin/ll) and I could then execute the script using ll from any folder.

Since upgrading to El Capitan I am unable to load this script. I have disabled SIP so that I am able to create the symlink and the script is definitely executable. The location (/usr/bin) is definitely in the $PATH and I have even tried adding a path to the script into the $PATH too.

Nothing seems to work, all I am getting is -bash: ll: command not found.

I have restarted the terminal after each update to the $PATH and I have tried source ~/.bash_profile but neither are making any difference.

Edit: I also tried adding the current directory of the scripts to the $PATH and that was also giving the same error. In the end I have aliased all my scripts so that they will run.
Just read the comments and see that you're looking for a general solution, rather than that specific example. I'll leave my previous answer in case it helps someone, but here's a more general solution.

My first piece of advice: leave /usr/bin alone. There's no reason to mess with it and there are many reasons not to mess with it. Instead, add a directory somewhere else, put you scripts there, and add it to you $PATH variable. If you want this just for your user, you could create a scripts or bin directory in your home directory, or if you want it globally available you could put it under /usr/local, e.g. /usr/local/scripts or /usr/local/bin. Then, in the .bashrc file in your home directory, add the following:

export PATH=$PATH:~/scripts:/usr/local/scripts


If you would rather have your commands override a system command (should they have the same name) then you could do the following, instead:

export PATH=~/scripts:/usr/local/scripts:$PATH


If you want this set for all users, then there is a global /etc/bashrc file that you can add the above to.

In order to edit the global bashrc or modify /usr/local you need root/admin privileges.