Bash, I command thee to always...
October 22, 2007 4:27 PM Subscribe
How do I get bash to automagically execute a line or two of code at login?
posted by nakedcodemonkey to computers & internet (25 answers total) 5 users marked this as a favorite
I ssh into various web servers all day long. They're helpfully *cough* configured to log me off after a few minutes inactivity, so re-logging in happens a lot. Then the re-return to the correct working directory. Where do I put something like 'cd ~/foo/bar' to instruct bash to execute that step (and whatever other convenience steps I can think of) automatically at shell login? I tried just dropping that into ~/.bash_profile, but no dice. 'chmod +x ~/.bash_profile' didn't make a difference.