Bash Startup Scripts: .bashrc and .bash_profile

FAIL (the browser should render some flash content, not this).

Download in .ogv format


Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Good tech tip

octopusgrabbus's picture

Thanks for the helpful video. .bash_profile and .bashrc also get confusing when moving between distros, like Red Hat and Ubuntu, so it was nice to have a straightforward explanation.


Anonymous's picture

"sorry if this is confusing, but this is how we do it"

probably should be a little more informative than that for noobs. But for the rest of us, good to know when each .bash... is called. thx

yep #1

Gen2ly's picture

unnecessary to make executable


Adrian Ponoran's picture

Why did you have to make .bash_profile executable. It is always sourced in and not executed directly ?

Nice explanation

mattcen's picture

That's interesting. I was under the misapprehension that one was for interactive, and one for non-interactive logins (so one is run by scripts for example, while the other is run by an interactive shell).

It raised a new question. What determines whether a shell is a "login" shell or not? Is the login shell just the first one you open when you log into a freshly booted system?

It's good to clear that up though :D.


Matthew Cengia


Niosus's picture

Very handy! i have been looking for something like this.

Just one note: can you make the sound in your videos a little bit loader, i have to crank up my speakers to hear you ;)

White Paper
Linux Management with Red Hat Satellite: Measuring Business Impact and ROI

Linux has become a key foundation for supporting today's rapidly growing IT environments. Linux is being used to deploy business applications and databases, trading on its reputation as a low-cost operating environment. For many IT organizations, Linux is a mainstay for deploying Web servers and has evolved from handling basic file, print, and utility workloads to running mission-critical applications and databases, physically, virtually, and in the cloud. As Linux grows in importance in terms of value to the business, managing Linux environments to high standards of service quality — availability, security, and performance — becomes an essential requirement for business success.

Learn More

Sponsored by Red Hat

White Paper
Private PaaS for the Agile Enterprise

If you already use virtualized infrastructure, you are well on your way to leveraging the power of the cloud. Virtualization offers the promise of limitless resources, but how do you manage that scalability when your DevOps team doesn’t scale? In today’s hypercompetitive markets, fast results can make a difference between leading the pack vs. obsolescence. Organizations need more benefits from cloud computing than just raw resources. They need agility, flexibility, convenience, ROI, and control.

Stackato private Platform-as-a-Service technology from ActiveState extends your private cloud infrastructure by creating a private PaaS to provide on-demand availability, flexibility, control, and ultimately, faster time-to-market for your enterprise.

Learn More

Sponsored by ActiveState