Solved

My bash alias isn't executing

Posted on 2016-11-09
5
32 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
  • 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I am a long time windows user and for me it is normal to have spaces in directory and file names. Changing to Linux I found myself frustrated when I moved my windows data over to my new Linux computer. The problem occurs when at the command line.…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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.

760 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now