LinuxQuestions.org
Visit Jeremy's Blog.
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
 
LinkBack Search this Thread
Old 05-06-2004, 05:28 PM   #1
xenia
LQ Newbie
 
Registered: Apr 2004
Location: Athens
Posts: 8

Rep: Reputation: 0
where is the .bashrc file???


where is the .bashrc file???this sentence sums up pretty much all my problems.I' using Slackware 9.1 in my computer.I've recently installes a programm (network simulator 2)and each time I use it I have to set the Paths right from the strat because I can't find the .bashrc file.It has driven me mad!!!Should I create it by myself, where and how do I set the path?

P.S. I'm really new at this and I would appreciate it if someone could tell me some simple steps of what to do
 
Old 05-06-2004, 05:50 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 22,950
Blog Entries: 11

Rep: Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860Reputation: 860
Kalimera!

Yep, you should create one yourself.

Slack is minimalistic, Pat doesn't cusotmize things
(or very little) for you. Most packages in slack will
come as if you had built your LFS, no pre-fabed
configurations.


Cheers,
Tink
 
Old 05-06-2004, 05:54 PM   #3
deloptes
Member
 
Registered: Feb 2004
Location: AT
Distribution: debian etch and SUSE 10.2
Posts: 123

Rep: Reputation: 15
If you are new to something than you would be willing to learn - ain't you?!

now cdange into your home directory

Code:
cd ~
than type

Code:
ls -al | grep .bashrc
If you don't find it that way create it right there ...

and redefine your path i.e under bash

Code:
export PATH=<YOUR_PATH>:$PATH
the same you do with your MAN_PATH and so on

!!! BUT CAUTION !!!

putting PATH in your .bashrc will append the PATH each time you run a terminal, so it's better idea to use

.bash_profile, whilch should be also in your home directory

!!! LEARN !!!

the DOT files under linux are hidden (system) files and not visible

regards
 
Old 05-06-2004, 05:59 PM   #4
fancypiper
Guru
 
Registered: Feb 2003
Location: Sparta, NC USA
Distribution: Ubuntu 10.04
Posts: 5,141

Rep: Reputation: 57
You should find an example in /etc/skel. Here is an example for one of my users:
Code:
# Duron 950 uilleann .bashrc file for user fancy
# User specific aliases and functions

# Change bash prompt. See the article:
# http://www-106.ibm.com/developerwork.../l-tip-prompt/
export PS1='\d \@ \[\e[32;1m\]\u\[\e[34;1m\]@\[\e[36;1m\]\H \[\e[34;1m\]\w\[\e[32;1m\] $ \[\e[0m\]'
# For the root account use this
# export PS1='\d \@ \[\e[31;1m\]\u\[\e[34;1m\]@\[\e[36;1m\]\H \[\e[34;1m\]\w\[\e[31;1m\] # \[\e[0m\]'

# Set paths
alias path='echo -e ${PATH//:/\\n}'

# Start the screensaver daemon
alias saver='nohup xscreensaver &'

# Allow local users to use my X session
# xhost +local:

# Dialup, start fetchmail daemon and startx
alias x='/sbin/ifup ppp0;fetchmail -d 300;startx'

# Alter the ls command
alias ls='ls -ac'
alias lls='ls -lac'

# Become system administrator
alias god='su -'

# Connect/disconnect the internet by modem
alias dial='/sbin/ifup ppp0'
alias hangup='/sbin/ifdown ppp0'

# Realplayer
alias rp='/pub/home/fancy/RealPlayer8/realplay'
alias r1='/pub/home/fancy/RealPlayer9/realplay'

# Launch links with my linux links page
alias links='links /home/fancy/bookmarks.html'

# Power down/reboot
alias off='shutdown -h now'
alias boot='shutdown -r now'

# For nano editor because I forget which one I use in which distro
alias pico='nano -w'
alias nano='nano -w'

# This script needs to be on the bottom of the file or RH updates will fsck it up
# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi
 
Old 05-06-2004, 09:44 PM   #5
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
Quote:
Originally posted by fancypiper
alias path='echo -e ${PATH//:/\\n}'
holy poop. I spent hours one day trying to create something that would give this result. I don't quite understand what it means, but it works. Thanks.
 
Old 05-07-2004, 01:25 AM   #6
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Use the .bash_profile file instead. This file is sourced when you log in. The .bashrc file is sourced every time you start a bash shell.
 
Old 05-07-2004, 08:32 PM   #7
xenia
LQ Newbie
 
Registered: Apr 2004
Location: Athens
Posts: 8

Original Poster
Rep: Reputation: 0
Thank you all for your quick reply.I did the following:
1)I typed

ls -al | grep .bashrc

into my home directory and I found no .bashrc file.

2)I created myself under the same directory a .bash_profile file
(I used the vi editor to create the file and I saved it as .bash_profile under the home directory.Into the file I only wrote the path by typing

export PATH=/home/...../..../.....:$PATH

isnt't that right??Should I have added something else too??)

3)I rebooted my computer

After doing all these I went to the directory that I have installed the simulator
(I have installed it under the home directory , does this cause any problems??), I opened a terminal and I tried to run the simulator by typing the right order.

The simulator wouldn't run unless I set the PATH in the terminal right from the start as before. Everything I did with the .bash_profile file is ignored and I have to set the path right from the beginning.

What is wrong in all these??

P.S.I' m sorry for being so analytical but I' m completely lost
 
Old 05-07-2004, 09:26 PM   #8
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
export PATH=/home/...../..../.....:$PATH

The syntax is correct, but the paths themselves may be incorrect...what do you mean by "..../..../...."?
Hoping to make this a little more clear for you, suppose you have a directory within $HOME which you want to add to your $PATH, and this directory is /home/xenia/simulator.
In order to add this path to your $PATH variable, you'd do:
export PATH=/home/xenia/simulator:$PATH or PATH=~/simulator:$PATH or PATH=$HOME/simulator:$PATH
Each path added is separated by a colon.

Also, make sure that the simulator binary is located in the specific path which is added to your $PATH variable...if it's in a subdirectory of that path it won't work.

Rebooting is unnecessary...at most log out and log back in.

Last edited by mikshaw; 05-07-2004 at 09:31 PM.
 
Old 05-08-2004, 12:11 PM   #9
deloptes
Member
 
Registered: Feb 2004
Location: AT
Distribution: debian etch and SUSE 10.2
Posts: 123

Rep: Reputation: 15
hmm, are you using the x-termina or konsole.

try typing

Code:
echo $PATH
echo $SHELL
or

Code:
export | grep PATH
export | grep SHELL
before running the simulator

this way you'll se if the chages took effect, also you don't have to reboot (my God - those are the bad habits of using windows) . In the worst case it's enough to login under X again but usually it's enough to start another XTerm.

you might have different shell configured as default, also under KDE you must start konsole with the -ls option so that .bash_profile is read (simultates login shell)

Finally it's not hard to write a script that is setting up the path but watch out to have the abbility to extend your path from your login script

regards
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
reloading .bashrc file blackzone Linux - Newbie 8 03-02-2013 10:58 AM
Bashrc file Gins Linux - General 19 09-06-2005 03:19 PM
can't the file bashrc Paxmaster Linux - Software 10 01-02-2005 06:58 AM
bashrc file Linvilidiot Linux - Newbie 3 03-11-2004 04:08 PM
how to modify .bashrc file amadan_in Linux - Newbie 1 01-01-2003 03:55 AM


All times are GMT -5. The time now is 12:29 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration