When I work I often do:
cd ~/dev/lab/prod/
It is just an example but I would like to be able just to run:
prod
With the same effect (changing into the ~/dev/lab/prod folder).
When I work I often do:
cd ~/dev/lab/prod/
It is just an example but I would like to be able just to run:
prod
With the same effect (changing into the ~/dev/lab/prod folder).
Alias is what you are looking for.
For bash you have to do following steps:
1) Open your .bashrc
nano ~/.bashrc
2) Add new alias (at the end of file)
alias prod='cd ~/dev/lab/prod/'
3) Save and close the file
4) Source the .bashrc
file
source ~/.bashrc
5) Use created alias prod
for cd ~/dev/lab/prod/
command
Add the following line:
cd ~/dev/lab/prod
Make the file script executable:
chmod +x prod.sh
Run the file
./prod.sh