Tech Trivia #2: Linux Startup

Posted: April 12, 2009 in OS, trivia
Tags: , ,

Startup files in Linux: You want to add a command to be executed when the linux system boots. Then here is something you should know.

/etc/profile
systemwide defaults, mostly setting the environment (works on all Bourne-type shells)

/etc/bashrc
systemwide functions and aliases for Bash.Changes made will be affecting all the users.

$HOME/.bash_profile
user-specific Bash environmental default settings, found in each user’s home directory .User specific.

$HOME/.bashrc
user-specific Bash init file, found in each user’s home directory (the local counterpart to /etc/bashrc). Only interactive shells and user scripts read this file.

Logout :

Not just login, logout is also a point at which you would like something to happen

$HOME/.bash_logout
user-specific instruction file, found in each user’s home directory. Upon exit from a login (Bash) shell, the commands in this file execute.

PS: This does not apply to csh, tcsh, and other shells not related to or descended from the classic Bourne shell (sh).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s