Why my terminal starts with bash-4.2$ on fedora 18?
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Why my terminal starts with bash-4.2$ on fedora 18?
Dear users
I have got a problem and I need your help.
My terminal starts with bash-4.2$, and I don't know how to restore it back to normal working condition. Please how can I resolve this issue. What should I have done that make the terminal behave in this way? I already visit http://www.linuxquestions.org/questi...me-4175466096/
Your help is highly appreciated.
Regards
Lawal
Last edited by lmohammeed; 11-18-2013 at 08:02 AM.
Reason: forgot to add something
That appears to be a default bash shell prompt for logged in user (root user prompt would be bash-4.3#).
Quote:
I don't know how to restore it back to normal working condition.
What do you consider to be "normal working condition"?
You can set your prompt be editing your ~/.bashrc file. Look for the PS1 prompt line to edit. To find out what the default PS1 prompt is, as it was when you installed Fedora, look at /etc/bash.bashrc or /etc/skel/.bashrc. Copy the PS1 line and past it into your ~/.bashrc.
Dear users
I have got a problem and I need your help.
My terminal starts with bash-4.2$, and I don't know how to restore it back to normal working condition. Please how can I resolve this issue. What should I have done that make the terminal behave in this way? I already visit http://www.linuxquestions.org/questi...me-4175466096/
Your help is highly appreciated.
Regards
Lawal
You probably altered/deleted the .bashrc that shipped with Fedora.
Check in
Code:
/etc/skel/
for .bashrc and .bash_profile and copy them to your home directory.
Code:
lxde@gentoo-asus ~ $ ls -al /etc/skel
total 24
drwxr-xr-x 3 root root 4096 Oct 15 15:55 .
drwxr-xr-x 87 root root 4096 Nov 18 19:21 ..
-rw-r--r-- 1 root root 127 Oct 15 15:55 .bash_logout
-rw-r--r-- 1 root root 193 Oct 15 15:55 .bash_profile
-rw-r--r-- 1 root root 551 Oct 15 15:55 .bashrc
drwx------ 2 root root 4096 Dec 8 2011 .ssh
hmmm strange. There is home directory for user 'mohammed', but why you said "vi ~/.bashrc only works from root". besides its not 1(one), but its l(L) in ls -l /home. probably ownership is set wrong. Anyway try again ls -l /home
it show something like this
Code:
drwx------. 64 mohammed mohammed 4096 Nov 19 19:27 /home/mohammed
Last edited by Madhu Desai; 11-19-2013 at 08:25 AM.
Why my terminal starts with bash-4.2$ on fedora 18?
Thank you mddesai,
Quote:
as root you can open .bashrc, however, as user the .bashrc is NEW file...
yes.
I run the codes as you said, typed
PHP Code:
if [ -f /etc/bashrc ]; then . /etc/bashrc
fi
and source .bashrc file in the same terminal. Save and exit using
Code:
:wq!
However, instead of getting normal prompt I got empty prompt. I restart the system, now after several attempt the system would starts and then quickly asked for password again. I have use another computer to reply you.
Thanks once more
Lawal
and source .bashrc file in the same terminal. Save and exit using
Code:
:wq!
You should save the file first and then source it.
Quote:
Originally Posted by lmohammeed
However, instead of getting normal prompt I got empty prompt. I restart the system, now after several attempt the system would starts and then quickly asked for password again. I have use another computer to reply you.
Very strange. The only guess i can do now is that you have seriously messed-up something else. Running /etc/bashrc shouldn't be that dangerous .
Why my terminal starts with bash-4.2$ on fedora 18?
Thanks you so much mddesai,
Quote:
You should save the file first and then source it.
That really make me a Newbie.
If I get you right, after saving, then I should open the file again using vi editor and then source. Please confirm if I am right, just in case it happens again.
Quote:
Very strange. The only guess i can do now is that you have seriously messed-up something else. Running /etc/bashrc shouldn't be that dangerous .
If I get you right, after saving, then I should open the file again using vi editor and then source. Please confirm if I am right, just in case it happens again.
No... You got it wrong. Sourcing a script is similar to executing a script on shell. The only difference is that executing a script (with ./ or sh) will execute it in sub-shell, where as sourcing (with . or source) a script will execute it in current shell. So whatever changes you make in .bashrc, and when you source it, the contents of script are executed and are available to you on the same shell you are working on.
To put in simple words...
open vi editor (~/.bashrc)
enter the contents (post #11)
save the file (:wq) (dont open .bashrc again)
And in command prompt just type the following and press <enter>
Code:
$ . ~/.bashrc
Note: Or you can type the following... both are same
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.