0

I have been editing my .bashrc file to run some commands, such as appending directories to the PATH variable. However, from my knowledge, .bashrc is only executed when a terminal is opened. (Correct...?) In this case, in order to make the necessary changes to PATH, I would need to open up a terminal each time I log on to Ubuntu.

This doesn't seem like a very elegant thing to have to do, particularly for people who tend not to use the terminal much. Is there a way to run these commands when Ubuntu boots up, without requiring a terminal to be opened?

0

3 Answers 3

2

If I remember correctly, the ~/.profile file gets loaded upon login. Just make your ajustment there.

0

You can have the system/root run commands at boot if you adjust the /etc/rc.local file.

You should read over the documentation, but it's basically as simple as using .bashrc. You'll want to make sure that all of the commands 'terminate', as to not hang your boot.

Example:

/path/to/some.sh
exit 0
0

First of all, right-click the file in Nautilus and check the box Allow executing file as program. Then open up "Startup Applications" from the dash and click Add. Use ./.bashrc as the command.

1
  • @Karnivaurus Did this answer your question?
    – UTF-8
    Oct 11, 2015 at 18:54

Not the answer you're looking for? Browse other questions tagged .