Startup file is something that is started whenever the operating system starts. For example: For a login,
/bin/login file is used and the password is read and matched by reading the
/etc/passwd file. These both files are also the startup files. See, there are bunch of startup files in Linux and each files have their separate specific functions. Startup files are usually in home directory and are hidden by default.
To add your own startup file you need something called “ENV” environment variables. We will create a Environment file in .bashrc file and add our startup file in Linux. Bashrc file is a startup and script file in Linux and hidden by default. If you don’t know how to hide and unhide files in Linux, see this tutorial on how to hide and unhide files in Linux.
First create a file called .startup in your home folder. The file name can be varied but must be hidden. Go to terminal and open the .bashrc file from your favourite editor. I will use nano to open .bashrc file from terminal.
Let’s understand the above command. The environment variable is created in HOME and a file called .startup is assigned to it. Remember, we are creating startup file here so it must be hidden. Now, to prove we created a started up file go to .startup file and echo there anything. See also: echo command usage.
I have added three line of echo commands to .startup file. Now, when you open the terminal this three set of lines should be displayed. This is the startup file. As soon as you open the terminal the content of startup file is displayed.