Solved

My bash alias isn't executing

Posted on 2016-11-09
5
57 Views
Last Modified: 2016-11-09
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
Comment
Question by:amigan_99
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 23

Expert Comment

by:savone
ID: 41881067
You have to source the file... type:

source ~/.bashrc

and try again.
0
 
LVL 68

Accepted Solution

by:
woolmilkporc earned 500 total points
ID: 41881069
~/.bashrc is for non-login shells.
Use ~/.profile or ~/.bash_profile!
0
 
LVL 1

Author Comment

by:amigan_99
ID: 41881074
@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
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 41881080
~/.profile will be executed automatically!
1
 
LVL 1

Author Closing Comment

by:amigan_99
ID: 41881081
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
perl/awk/sed 7 27
NTPD Client Port Usage 12 94
Allow offline access point to have internet 5 37
bash: ./Facebooker.pl :Permission Denied 9 58
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
Fine Tune your automatic Updates for Ubuntu / Debian
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question