LinuxQuestions.org
Help answer threads with 0 replies.
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 06-25-2004, 06:45 PM   #1
NonSumPisces
Member
 
Registered: May 2004
Location: Västerås, Sweden
Distribution: Slackware Current
Posts: 228

Rep: Reputation: 30
adding aliases, refreshing .bashrc


This one has probably been asked many times already, but I can't find anything on it...

I like to make things simple for me when I'm working, so I've added quite a few aliases in the bashrc file. Thing is, I can't figure out how to make the aliases and functions usable without having to restart X or sometimes even the computer. This is irritating considering I'm adding stuff into .bashrc almost every day. Is there some way to "refresh" the computer so that the new .bashrc gets loaded into memory? When I used Mandrake 10 it happened automagically, but not in Slackware current, which I'm using now.
 
Old 06-25-2004, 07:00 PM   #2
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
You can just type "bash" at the prompt to reload bashrc

alternatively, you can make an alias file, for example lets call it .aliases, and call it in from your bashrc. This way, you can just type

$source /path_to_it/.aliases

and it will refresh your aliases. Then, just add your new aliases to this file from now on. Here's some examples...

snippet from /etc/bashrc to call file
-------------------------------------------------
if [ -f /home/jeff/.aliases ]; then
. /home/jeff/.aliases
fi
-------------------------------------------------

and here's the .aliases file...


alias decode='for i in *.mp3; do lame --decode $i `basename $i .mp3`.wav; done'
alias pu=pushd
alias po=popd
alias la='ls -al'

well, you obviously know how to set aliases, so you don't need that I guess.

Anywho...good luck...
 
Old 06-25-2004, 07:06 PM   #3
NonSumPisces
Member
 
Registered: May 2004
Location: Västerås, Sweden
Distribution: Slackware Current
Posts: 228

Original Poster
Rep: Reputation: 30
Thank you That solves my problem

Btw, isn't Minnesota the state to which most of the swedish imigrants came to last century? Just wondering.
 
Old 06-25-2004, 07:11 PM   #4
NonSumPisces
Member
 
Registered: May 2004
Location: Västerås, Sweden
Distribution: Slackware Current
Posts: 228

Original Poster
Rep: Reputation: 30
Or rather, it should have solved it.

doing bash doesn't do the trick for me... aterm won't recognize the new aliases.
I'll try your second solution though.
 
Old 06-25-2004, 07:17 PM   #5
jeffreybluml
Member
 
Registered: Mar 2004
Location: Minnesota
Distribution: Fedora Core 1, Mandrake 10
Posts: 405

Rep: Reputation: 30
Ya sure, you betcha...oofda

In other words, you are correct...
 
Old 06-25-2004, 07:23 PM   #6
NonSumPisces
Member
 
Registered: May 2004
Location: Västerås, Sweden
Distribution: Slackware Current
Posts: 228

Original Poster
Rep: Reputation: 30
Talking



Well, every eight year old in sweden knows that one third of this countrys population skipped over the big pool to "the land where chicken grow to the size of cows" a little over a hundred years ago O_o (a THIRD!!!) ^_^
 
Old 06-25-2004, 07:48 PM   #7
NonSumPisces
Member
 
Registered: May 2004
Location: Västerås, Sweden
Distribution: Slackware Current
Posts: 228

Original Poster
Rep: Reputation: 30
Your second solution worked quite well, I must say Even made an alias to reload .aliases
Now I just have some wrestling with alsa and the gfx card left to do before this box is atleast as usable as my w1nd0ze box ^_^
 
Old 06-26-2004, 12:04 AM   #8
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
Another option is to just open a new X terminal (close the current one if you wish)...each time a new terminal is opened it sources bashrc
 
Old 06-26-2004, 12:39 AM   #9
NonSumPisces
Member
 
Registered: May 2004
Location: Västerås, Sweden
Distribution: Slackware Current
Posts: 228

Original Poster
Rep: Reputation: 30
dang, why didn't I think of that....
 
  


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
Eterm doesn't import aliases from bashrc oldmanofthesea Linux - General 1 05-16-2005 08:17 AM
bashrc Aliases don't work soren625 Linux - Newbie 10 01-27-2005 09:59 AM
making aliases - no bashrc file disorderly Linux - Newbie 9 09-27-2004 05:57 PM
aliases in .bashrc file davalos Linux - Newbie 7 08-21-2003 02:03 PM
.bashrc aliases Crashed_Again Linux - General 8 01-30-2003 07:42 PM


All times are GMT -5. The time now is 10:24 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