Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,153,015 members, 7,817,992 topics. Date: Sunday, 05 May 2024 at 02:26 AM

Question Abt Bash - Programming - Nairaland

Nairaland Forum / Science/Technology / Programming / Question Abt Bash (822 Views)

Bash/shell Scripting In A Unix/linux Environment / Abt Lincence Key (2) (3) (4)

(1) (Reply)

Question Abt Bash by abdul01(m): 7:37pm On Feb 05, 2015
Q: how do u make an alias persist even after closing d shell.

E.g when I create an alias
$alias py="cd c:/www/py"
It successfully creates d alias and I can use it, but when I close d terminal(I use git bash on windows) n reopen it, d alias is gone.
Re: Question Abt Bash by nextstep(m): 9:07pm On Feb 05, 2015
Put the alias in your ~/.bashrc

~/.bashrc is executed every time you open a new terminal
~/.bash_profile is executed on a login shell (e.g. ssh into or serial console), but not when you open a new terminal
Re: Question Abt Bash by abdul01(m): 5:35am On Feb 07, 2015
Tnx a lot, I'v created d .bashrc in my home dir and added d alias too. But I noticed that I can only use it (d newly added alias) after restarting d terminal, but I found a way around this here(www.superuser.com/questions/602872/how-do-i-modify-my-git-bash-profile-in-windows) by using:

source .bashrc

after adding a new alias. Tnx

(1) (Reply)

How Can I Create A Blog. I Want To Be A Blogger / . / Exceptional Performance. Thats What You Get....

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 7
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.