Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

what is .bashrc - How to find the startup file - putty

Tags:

linux

putty

I was going over this article and it states in step 3

Add the following to your .bashrc (or the appropriate startup file for your shell)  To use it immediately, be sure to type “source .bashrc” 

Any idea on how I could know what my startup file is ? I am using putty ?

like image 226
MistyD Avatar asked Dec 04 '13 19:12

MistyD


People also ask

Where can I find .bashrc file?

In most cases, the bashrc is a hidden file that lives in your home directory, its path is ~/. bashrc or {USER}/. bashrc with {USER} being the login currently in use.

How do I open a .bashrc file in putty?

Once you use putty to SSH into your server, you can run "ls -al . bashrc" and it should show you the file, edit this with an editor you know, if none, then use vi like this "vi . bashrc". Go to where you need to edit the file and type in "i" to put vi in Insert mode.

What is my bashrc file?

bashrc file is a script file that's executed when a user logs in. The file itself contains a series of configurations for the terminal session. This includes setting up or enabling: coloring, completion, shell history, command aliases, and more. It is a hidden file and simple ls command won't show the file.

Where is my bash shell startup file?

This shell invocation normally reads /etc/profile and its private equivalent ~/. bash_profile (or ~/. profile if called as /bin/sh) upon startup. An interactive non-login shell is normally started at the command-line using a shell program (e.g., [prompt]$ /bin/bash) or by the /bin/su command.


1 Answers

Once you use putty to SSH into your server, you can run "ls -al .bashrc" and it should show you the file, edit this with an editor you know, if none, then use vi like this "vi .bashrc".

Go to where you need to edit the file and type in "i" to put vi in Insert mode. Next type in your text. Once you are done press the escape button and ":wq", no quotes for the i or :wq.

Next you can source it by typing "source .bashrc" and the setting you added should be part of your BASH shell environment now.

like image 185
JDubTech Avatar answered Sep 20 '22 16:09

JDubTech