.bashrc file

Hi experts,

I am using bash shell and I cant find any .bashrc file in my home dir. Can anybody please help me out here....

If .bashrc file is not there, from where my shell config operates? Also I want to set my prompt like...

[server:working_dir]$

Please advice.

There must be a system-wide .bashrc somewhere (may be in /etc) that will server as default bashrc if not present in your home directory.

For your prompt, add this line in the .bashrc from your home directory:

PS1='[\h:\w]$ '

To add this code in .bashrc file, I need to create it first...
can you please show me how can I create it? format?

echo 'PS1=\'[\h:\w]$ \'' > .bashrc

Or just:

<favourite editor> .bashrc

then type what you wish in there

Hi.

On Linux systems there are files often used as sources for new account (login) creations. On the system:

OS, ker|rel, machine: Linux, 2.6.26-2-amd64, x86_64
Distribution        : Debian GNU/Linux 5.0 

the .bashrc file is at:

/etc/skel/.bashrc

It's about 100 lines and should be a good start.

Best wishes ... cheers, drl

man bash:

       When bash is invoked as an interactive login shell, or as a
       non-interactive shell with the --login option, it first reads
       and executes commands from the file /etc/profile, if that file
       exists. After reading that file, it looks for ~/.bash_profile,
       ~/.bash_login, and ~/.profile, in that order, and reads and
       executes commands from the first one that exists and is
       readable. The --noprofile option may be used when the shell is
       started to inhibit this behavior.

       When an interactive shell that is not a login shell is started,
       bash reads and executes commands from ~/.bashrc, if that file
       exists. This may be inhibited by using the --norc option. The
       --rcfile file option will force bash to read and execute
       commands from file instead of ~/.bashrc.

---------- Post updated at 04:29 PM ---------- Previous update was at 04:23 PM ----------

100 lines is excessive. On mine (Mandriva), there are three uncommented, non-empty lines.