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 ;)

One Click, Universal Protection: Implementing Centralized Security Policies on Linux Systems

As Linux continues to play an ever increasing role in corporate data centers and institutions, ensuring the integrity and protection of these systems must be a priority. With 60% of the world's websites and an increasing share of organization's mission-critical workloads running on Linux, failing to stop malware and other advanced threats on Linux can increasingly impact an organization's reputation and bottom line.

Learn More

Sponsored by Bit9

Linux Backup and Recovery Webinar

Most companies incorporate backup procedures for critical data, which can be restored quickly if a loss occurs. However, fewer companies are prepared for catastrophic system failures, in which they lose all data, the entire operating system, applications, settings, patches and more, reducing their system(s) to “bare metal.” After all, before data can be restored to a system, there must be a system to restore it to.

In this one hour webinar, learn how to enhance your existing backup strategies for better disaster recovery preparedness using Storix System Backup Administrator (SBAdmin), a highly flexible bare-metal recovery solution for UNIX and Linux systems.

Learn More

Sponsored by Storix