Linux - General This 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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
 |
01-03-2005, 02:20 PM
|
#1
|
Member
Registered: Jan 2003
Location: New Mexico
Distribution: Ubuntu 18.04.3 LTS
Posts: 539
Rep:
|
setting alias in bash, permanently
I want to set some permanent aliases for the bash shell.
This would be for all users on my box, which would be my regular user acct and root.
I created the file /etc/profile.local and added some lines like:
alias cdcpp='cd /development/C++'
alias cddoc='cd /document'
but the aliases don't get defined.
I've even restarted the box to be certain.
What do I need to do?
SuSE 9.2 Pro
|
|
|
01-03-2005, 02:37 PM
|
#2
|
Moderator
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047
Rep:
|
They will only last for a bash session, you will need to reset them each time the shell is started. The easiest way would be to put them in your startup script ~/.bashrc or for all users /etc/bashrc
|
|
|
01-03-2005, 02:43 PM
|
#3
|
Member
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683
Rep:
|
hmm never messed around with profile.local (set up a test one just for fun though)
Somethings to check:
does the following lines show up in your /etc/profile:
# And now let's see if there is a local profile
test -s /etc/profile.local && . /etc/profile.local
in my /etc/profile.local I put the following:
alias list=ls
After I logged out and logged back in 'list' appears to work.
|
|
|
01-03-2005, 02:57 PM
|
#4
|
Member
Registered: Jan 2003
Location: New Mexico
Distribution: Ubuntu 18.04.3 LTS
Posts: 539
Original Poster
Rep:
|
>>The easiest way would be to put them in ... for all users /etc/bashrc
My bash.bashrc file says:
# PLEASE DO NOT CHANGE /etc/bash.bashrc There are chances that your changes
# will be lost during system upgrades. Instead use /etc/bash.bashrc.local
>>does the following lines show up in your /etc/profile:
>># And now let's see if there is a local profile
>>test -s /etc/profile.local && . /etc/profile.local
yes
|
|
|
01-03-2005, 03:18 PM
|
#5
|
Member
Registered: Jul 2003
Location: Clinging to my guns and religion.
Posts: 683
Rep:
|
Both my /etc/profile.local and /etc/bash.bashrc.local work
What kind of file permissions do you have on them? (does everyone have at least read access?)
|
|
|
01-03-2005, 04:02 PM
|
#6
|
Member
Registered: Jan 2003
Location: New Mexico
Distribution: Ubuntu 18.04.3 LTS
Posts: 539
Original Poster
Rep:
|
permissions are at least read.
/etc/bash.bashrc.local works (for both root and regular user)
but for some reason /etc/profile.local doesn't, maybe its a SuSE thing
anyway, good enough.
thanks for your help
|
|
|
10-24-2008, 04:10 AM
|
#7
|
Member
Registered: Apr 2007
Posts: 195
Rep:
|
the bash is will be affect when login ?
if I want to system start up without login, how can I do?
|
|
|
All times are GMT -5. The time now is 01:57 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|