Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then 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.
I have a VM of Fedora 12 set up for school. I was instructed to set it up to start in runlevel 3. I also have a habit of customizing my .bashrc file. I create a lot of aliases for CDing to various directories among other things. I was doing this before I started x. I was in the /var/www directory when I started x. I noticed after I was in gnome that whenever I started a terminal it would open up to the /var/www directory. My question is, is this normal?
My second question is dealing with my .bashrc file. I edited the file for root. When I open up the terminal in user it did not have any of my aliases from root. I have searched and thought I had it figured out how to get they to "sync" for lack of better word. Any suggestions would be helpful. I will copy and past my root .bashrc file and user file below.
user .bashrc file
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ..='cd ..'
alias ..2='cd ../..'
alias ..3='cd ../../..'
alias ..4='cd ../../../..'
alias ..5='cd ../../../../..'
alias ll='ls -l'
alias l='ls -ltr'
alias cls='clear'
alias Desktop='cd /home/hazmat/Desktop'
alias desktop='cd /home/hazmat/Desktop'
alias Documents='cd /home/hazmat/Documents'
alias docs='cd /home/hazmat/Documents'
alias documents='cd /home/hazmat/Documents'
alias Downloads='cd /home/hazmat/Downloads'
alias downloads='cd /home/hazmat/Downloads'
alias Music='cd /home/hazmat/Music'
alias music='cd /home/hazmat/Music'
alias movies='cd /home/hazmat/Videos'
alias Movies='cd /home/hazmat/Videos'
alias Videos='cd /home/hazmat/Videos'
alias videos='cd /home/hazmat/Videos'
alias vids='cd /home/hazmat/Videos'
alias pics='cd /home/hazmat/Pictures'
alias Pictures='cd /home/hazmat/Pictures'
alias pictures='cd /home/hazmat/Pictures'
alias x='exit'
alias bashrc='vi ~/.bashrc'
root .bashrc file
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ..='cd ..'
alias ..2='cd ../..'
alias ..3='cd ../../..'
alias ..4='cd ../../../..'
alias ..5='cd ../../../../..'
alias ll='ls -l'
alias l='ls -ltr'
alias cls='clear'
alias Desktop='cd /home/hazmat/Desktop'
alias desktop='cd /home/hazmat/Desktop'
alias Documents='cd /home/hazmat/Documents'
alias docs='cd /home/hazmat/Documents'
alias documents='cd /home/hazmat/Documents'
alias Downloads='cd /home/hazmat/Downloads'
alias downloads='cd /home/hazmat/Downloads'
alias Music='cd /home/hazmat/Music'
alias music='cd /home/hazmat/Music'
alias pics='cd /home/hazmat/Pictures'
alias Pictures='cd /home/hazmat/Pictures'
alias pictures='cd /home/hazmat/Pictures'
alias movies='cd /home/hazmat/Videos'
alias Movies='cd /home/hazmat/Videos'
alias Videos='cd /home/hazmat/Videos'
alias videos='cd /home/hazmat/Videos'
alias vids='cd /home/hazmat/Videos'
alias x='exit'
alias bashrc='vi ~/.bashrc'
alias home='cd /home'
alias hazmat='cd /home/hazmat'
alias var='cd /var'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
(I copied the aliases from one to the other until I can figure out what I am doing wrong. I googled it quite a bit before asking but my google-fu seems to be weak today)
No I used su then the root password, to the best of my knowledge Fedora 12 does not have a sudo account set up.
#EDIT# I guess Fedora 12 does have sudo but needs setup, I have not done this. I edited the .bashrc files in root. Tested them and they worked. Then I tried to test them as user, they did not. I then copied all my aliases from root to user in vim and then deleted them from root. Worked in user, but not root. So I tried the script that was suggested. (It is above) Messed with it some more and still could not figure it out .
Re q1)
Yes, that's normal. All sub-shells will inherit the PWD from the
shell you spawn them from; even a DE/WM will, hence gnome (and all
terminal windows started from it) will have the same PWD.
Re q2)
Use "su - " to get root's work environment - "su" will keep the
environment of the user invoking it.
So if I understand this correctly for the first answer, since I ran the command startx from the /var/www directory all my sub terminals start from there. Not a big deal just found it to be curious.
For the second question maybe I am not asking it correctly. I am trying to get the .bashrc files to be made in one spot and have both my user account and root account recognize it. After a little more thought I realize you would not want to do this on a server but would be a nice thing to have on my home machines. Since I have started this thread though I have decided to just make a default .txt file to carry on my thumbstick that I can just copy and past in vim whenever I set up a new install. Since I will not be editing them by hand any more in vim I will just consider this a closed thread.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.