5

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!

Radu Rădeanu
  • 169,590
lelelelelelele
  • 347
  • 2
  • 3
  • 9

1 Answers1

15

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)

Oli
  • 293,335