Whenever I login to my Linux server I'd like to have several commands run automatically (set some variables, change location, etc.)
This needs to be done on user login, not on system start.
How can I set it to do this?
This question came from our site for professional and enthusiast programmers.
Put the commands in
If you need commands to only run when logging in via ssh (but not when logging in physically), you could probably test for the presence of the
|show 4 more comments|
Just put this in ~/.bashrc or /etc/bash.bashrc if you want this for all users: