LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-08-2009, 01:58 PM   #1
tulsi
Member
 
Registered: Aug 2009
Location: Chennai
Posts: 54

Rep: Reputation: 15
Question How to retain .bashrc file?


Hi,


some persons are delete .bashrc file. but console has bashrc file and bash_history file . how do i get .bashrc file. shell display bash 3.2#.
no files in /etc/skel.
also i tried ls -al no listing for .bashrc and bash_profile.

Last edited by tulsi; 09-08-2009 at 07:12 PM.
 
Old 09-08-2009, 04:03 PM   #2
adam999
Member
 
Registered: Sep 2006
Posts: 105

Rep: Reputation: 18
grab another copy of .bashrc from /etc/skel
 
Old 09-08-2009, 04:03 PM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Hi,

How do you have the permissions setup for the '.bashrc' and '.bash_profile';

Code:
example;

# ls -al
total 116
drwx--x--x 15 gws  users  4096 2009-09-08 08:19 .
drwxr-xr-x  6 root root   4096 2009-06-06 16:25 ..
-rw-------  1 gws  users    98 2009-09-08 08:19 .Xauthority
-rw-r--r--  1 root root    116 2009-08-24 10:19 .bash_profile
-rw-r--r--  1 root root    934 2009-08-24 10:18 .bashrc
 
Old 09-08-2009, 05:31 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
The .bashrc file is a bash script controlled by the user that is run every time a bash shell (e.g., "terminal window") is started. Nothing in that script is intended to be run for every system user.

If you want something to be executed by everyone, put the commands in /etc/bashrc instead of the user's ~/.bashrc file. Note that the /etc/bashrc program can easily contain user-specific commands:
Code:
...
if [ "$USER" = "user_name" ]
then
  ...
fi
and so on.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you move a file or directory and still retain mtime? ddenton Linux - General 3 11-21-2008 04:54 PM
bashrc file LinuxUser101 Linux - Newbie 4 04-14-2008 07:55 PM
retain file permission lightpace Linux - Newbie 1 12-06-2007 12:47 AM
Retain original squid.conf file ALInux Linux - Networking 1 06-02-2006 10:16 PM
Vi - retain position in file between invokations of vi Xanadu Linux - Software 1 12-23-2004 02:33 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration