LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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, 02: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 08:12 PM.
 
Old 09-08-2009, 05:03 PM   #2
adam999
Member
 
Registered: Sep 2006
Posts: 102

Rep: Reputation: 18
grab another copy of .bashrc from /etc/skel
 
Old 09-08-2009, 05:03 PM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,542
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
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, 06:31 PM   #4
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,186

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 05:54 PM
bashrc file LinuxUser101 Linux - Newbie 4 04-14-2008 08:55 PM
retain file permission lightpace Linux - Newbie 1 12-06-2007 01:47 AM
Retain original squid.conf file ALInux Linux - Networking 1 06-02-2006 11:16 PM
Vi - retain position in file between invokations of vi Xanadu Linux - Software 1 12-23-2004 03:33 PM


All times are GMT -5. The time now is 10:18 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration