• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 78
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

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