Thursday, April 25, 2024
15
rated 0 times [  15] [ 0]  / answers: 1 / hits: 17223  / 3 Years ago, sun, june 6, 2021, 3:56:50

In the Ubuntu terminal I find myself spending considerable time to switch to a particular directory every time the computer starts up. Is there some way I can make this process easier? Is there some hotkey or some quick directory change that I can use (like speed dial on a phone)?



 eg:
cd 1:Changes to saved directory one

More From » command-line

 Answers
3

There are two options:




  1. If you want to be in a specific directory everyt time you open a bash terminal, edit your ~/.bashrc file and just add the line cd Directory, for example cd ~/Desktop.


  2. If you want to have several short-cuts, you can always use global variables, which you can set in your ~/.bashrc file as follows export a=/tmp and then you would be able to do cd $a which would bring you to /tmp.




Remember that after editing your .bashrc file you have to restart the terminal or open a new one.


[#33815] Tuesday, June 8, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ibuteking

Total Points: 35
Total Questions: 128
Total Answers: 138

Location: Indonesia
Member since Thu, Oct 1, 2020
4 Years ago
;