Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

my question is the one which is written in the title.

I installed a program (Teamspeak 3 Client) on my Ubuntu 12.04 LTS Clientversion System. Now I would like to start it in the terminal with the command "teamspeak3". The program is installed in "/opt/teamspeak3/" and I am new on Linux.

So how to create such a command?

So it would be really nice, if someone could help me :)

Thanks a lot!

share|improve this question

marked as duplicate by Radu Rădeanu, user68186, Kevin Bowen, Thomas W., Alvar Jun 20 '13 at 17:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

add comment

1 Answer 1

up vote 9 down vote accepted

The answer to your wider question:

  • Create a new file in ~/bin/ (create it if it doesn't exist).
  • Write your script:

    #!/bin/bash
    
    # do something here.
    
  • Give that file executable permissions:

    chmod +x ~/bin/filename
    

In your particular case you could:

  • Symlink the executable into /usr/bin/:

    sudo ln -s /opt/teamspeak3/teamspeak3 /usr/bin/
    

    This won't always work. Some things behave strangely when symlinked and some things need to be run from the right path... But it's simple and it might work.

  • Or, you could write a little script (as above) but in /usr/bin/ instead of ~/bin/ (you'll need to prepend the commands with sudo)

share|improve this answer
    
Thanks a lot mate, that symbolix link in /usr/bin solved my problem! --> Thumbs up! –  Jenne Jun 20 '13 at 11:18
add comment

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