user1766050
user1766050

Reputation: 26

Using source command automatically when I open a terminal

I regularly use the command SOURCE to be able to open a software. So I type :

source /usr/blabla/blabla

softwarelaunch

I wonder if it is possible to call the source command everytime I launch a terminal. So I would only have to launch et terminal and to type softwarelaunch.

Upvotes: 1

Views: 1253

Answers (2)

Charles Boyd
Charles Boyd

Reputation: 316

Add something like this to your ~/.bashrc:

if [ -f /usr/local/foo/bar ]; then
   . /usr/local/foo/bar
fi

Upvotes: 0

alestanis
alestanis

Reputation: 21863

This is what the file ~/.bashrc is for!

This file gets sourced every time you open a terminal window. If you want to execute /usr/bla/bla then you can add a line at the end of the ~/.bashrc file:

source /usr/bla/bla

Upvotes: 1

Related Questions