Shell - (Startup|Login) script (.bash_profile, .profile, .login)

Bash Liste Des Attaques Ovh


The shell login scripts are the script that launch automatically after a login shell and permit to store permanently the values of environment variables.


Login Script By Shell

You can found them in two directory:

  • in the home user (~) for a user scope
  • in the /etc/ directory for a system scope. The /etc/ files contains system wide environment stuff and startup programs. All customization that you put in this file will apply for the entire environment variable on your system.

The login script mechanisms depends of the shell type.

Scope Shell Script or directory to modify
User Bash ~/.bash_profile
User Bourne or Korn shell ~/.profile
User C shell (csh) ~/.login
Global (All users except root) Bash /etc/profile.d
root Bash /root/.bash_profile


Bash - The /etc/profile is the main entry point and call all custom script in the directory (/etc/profile.d). Add your global configuration in this directory. Example:

export JAVA_HOME=$(readlink -f /usr/bin/java | sed "s:/bin/java::")

How changes can take effect immediately?

You can then make the changes to .bash_profile take effect immediately by typing the following command:

source .bash_profile

  • By adding paths to your .bash_profile, you can place utilities and programs in your path and be able to execute them without having to type ./ in front of the command.
  • the source command and the point '.' are similar:
source ./.bash_profile

is the same as

. ./.bash_profile

How to edit it ?

To edit the bash_profile :

  • change to your home directory (ie: /home/myname)
  • edit the file. Example with gedit.
gedit .bash_profile

Note the fullstop before 'bash'. This '.' makes it a hidden file

Discover More
Azure Firewall Public Ip Restriction
Azure - Oracle Database Manually Installation on Linux

The installation of the Oracle database on bare-bone Linux. For a quick an dirty installation, see Creation of a VM with Oracle Linux 7 Update 4 and a Standard_DS1_v2...
Bash Liste Des Attaques Ovh
Bash - (Environment) Variable

A variable is a parameters referenced by a name. parameter A variable has: a value and zero or more attributes (such as integer, ...). Attributes are assigned using the declare builtin command....
Bash Liste Des Attaques Ovh
Bash - (GNU) Bourne-Again SHell

Bash is an sh-compatible shell. It is intended to conform to the IEEE POSIX P1003.2/ISO 9945.2 Shell and Tools standard. Bash is the shell, or command language interpreter, that will appear in the GNU...
Bash Liste Des Attaques Ovh
Bash - Alias (of a command) - Builtin command

Alias allows to define shortcuts and synonyms for commonly used: shell commands (of group of command) or script The basic syntax is: where: p is to only print the aliases [name[=value]...
Linux - How to set the $PATH environment variable?

The environment variable is a list of which directories Linux will search for for executable files. As in DOS, the shell uses the PATH variable to locate a command. PATH contains a list of directories...
Linux - Umask (user mask)

umask also known as: user mask user file creation mask is a security command and a function in POSIX environments that sets the default privileges that a file get when it's created. When a shell...
Linux - to command

to is an user command to be able to visit a domain and to enter in a new working environment (given by the domain specification). The commands are passed to the command interpreter. Without commands...
Obi Edition
OBIEE 10G - Linux OEL 5 x86 Installation version

Open the Set the JavaHome parameter to the point to the new JDK location. For example, . tail Oracle BI Java Host start-up details: /usr/local/OracleBIData/web/log/javahost.out.log Oracle BI Java...
Obiee 11.1 Internet Explorer 6 Not Supported
OBIEE 11g - Oracle Business Intelligence 11.1 Simple installation steps on Windows and OEL Linux 32 bit

Open the setSOADomainEnv.cmd file, located in your Update the PORT_MEM_ARGS entry as follows: set PORT_MEM_ARGS=-Xms512m -Xmx1024m Save the file and close. ;-) Oracle®...

Share this page:
Follow us:
Task Runner