• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 72
  • Last Modified:

My bash alias isn't executing

I just have one line in my .bashrc - an alias that strives to cd to a specific directory.
What am I missing?

-bash-3.2$ more .bashrc
alias configs='cd /opt/rancid/all-configs'

-bash-3.2$ configs
-bash: configs: command not found

uname -a
Linux cacti-foo 2.6.18-164.el5 #1 SMP Thu Sep 3 03:28:30 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
0
amigan_99
Asked:
amigan_99
  • 2
  • 2
1 Solution
 
savoneCommented:
You have to source the file... type:

source ~/.bashrc

and try again.
0
 
woolmilkporcCommented:
~/.bashrc is for non-login shells.
Use ~/.profile or ~/.bash_profile!
0
 
amigan_99Network EngineerAuthor Commented:
@saveone - that did the trick. Is there a way I can make that persistent so it works for every login? I tried adding "source ~/.bashrc" as line 1 of .bashrc. But no joy there.
0
 
woolmilkporcCommented:
~/.profile will be executed automatically!
1
 
amigan_99Network EngineerAuthor Commented:
putting the line in .profile did exactly what I needed. Thank you. For some reason it didn't let me add saveone as assisted answer. But thank you also.
0

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now