Home > Enterprise >  How to open a specific directory by default on start up of Command line?
How to open a specific directory by default on start up of Command line?

Time:12-22

When I start up command line, I want a specific directory to be opened by default without me having to type a long path.

e.g. every time I open a terminal I want to be in directory ~/Desktop/foo/bar, so I want the following to happen

ctrl alt t
-> "terminal opens"
pwd
-> <yourPath>/Desktop/foo/bar

CodePudding user response:

You can put this line at the end of your ~/.bashrc file (or equivalent if you're using a different shell than bash):

cd <yourPath>/Desktop/foo/bar

CodePudding user response:

Just add a command to the end of your .bashrc

cd /path/to/dir
  • Related