I have a folder in ~
called work
that contains all my work. Usually when I start an instance of Terminal I type cd work
.
I would like to avoid this because it's very repetitive. I tried putting cd work
in my .bashrc
but I realized that I don't always want to cd work
- for instance, when I Open Terminal here
or when I open a Terminal in VSCode (which should open my Terminal in the current project directory, not work
).
My idea is having the Terminal type out cd work
whenever I open it, but not actually execute the command. If I really need to cd work
, all I have to do is hit Return. However, if I don't want to do that, I can just Ctrl+C
.
Is doing this possible?
man bash
, the "INVOCATION" section. You can probably[[ -n "$PS1" ]] && cd work
, by why not type the 8 characters? – waltinator Mar 26 '21 at 00:38