I'm trying to setup a simple alias to move me into my Developer folder on my machine. However, after setting it up, I get a weird error:
-bash: dv: command not found
I setup my alias in .bashrc like so:
alias dv='cd Developer/'
I use it by just typing dv
, and then get that error. Does anyone see any syntax errors or something I'm missing here for aliases?
Install a package Sometimes when you try to use a command and Bash displays the "Command not found" error, it might be because the program is not installed on your system. Correct this by installing a software package containing the command.
BASH Alias is a shortcut to run commands using some mapping. It is a way to create some shortcut commands for repetitive and multiple tasks. We create an alias in a BASH environment in specified files.
Run bash
and then try the command.
Alternatively, put it in ~/.bash_profile
which should be loaded automatically.
.bashrc
is only read on startup. If you just modified your .bashrc
then you need to get a new shell or get your current shell to see the changes applied:
source ~/.bashrc
in your current shell (although this may cause some startup items to run twice, which could cause other issues)exec bash
to get a new shellIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With