Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to create a shell script i can run from anywhere in the terminal,

the script simply echoes a message

echo "Excellent work Snake!"

I changed the scripts permissions with

chmod 775

the script is in my documents, i made a symbolic link to /usr/bin with

ln -s ./ /usr/bin

when i run the script from home for example, instead of the message echoing, nothing happens, e.g.

babbleshack@babbleshack ~ $ test
babbleshack@babbleshack ~ $ 

am i failing to understand something?

share|improve this question
up vote 4 down vote accepted

test is a bash builtin - called with no arguments, as in your example, it does nothing1.

Your shell script is not called test but, so to run it you need to type:


However, that's not the only problem. Your command ln -s ./ /usr/bin isn't doing quite what you think - ./ is a relative path, and links to relative paths are relative to the location of the link, not relative to where you were when you typed the command.

You actually want something like:

$ ln -s /home/babbleshack/ /usr/bin

... at which point things ought to work.

1 Technically, it unsuccessfully does nothing (in other words, it returns a non-zero error code). If that means nothing to you, don't worry - it's not important for the purposes of this answer.

share|improve this answer
when i run i get command not found error. I am going to try renaming my script – Babbleshack Aug 17 '13 at 21:25
I renamed my file to made a link and i am getting a 'command not found' error – Babbleshack Aug 17 '13 at 21:30
@Babbleshack that probably means your ln -s ./ /usr/bin failed ... do you see an entry for /usr/bin/ if you type ls -l /usr/bin/te*? – Zero Piraeus Aug 17 '13 at 21:31
@Babbleshack are you sure that you successfully made the link? What's in /usr/bin? – Zero Piraeus Aug 17 '13 at 21:32
yer its there i ran ls | grep testme in /usr/bin and it shows the link – Babbleshack Aug 17 '13 at 21:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.