3 ms·
Right, was going to mention CDPATH but searched the thread first to see if anyone already had. Also, as you have said, 'cd -' is useful; more so if you often to
by vram22 11y ago
Right, was going to mention CDPATH but searched the thread first to see if anyone already had. Also, as you have said, 'cd -' is useful; more so if you often toggle between two dirs, such as a src and a corresponding bin dir (e.g. doing C dev), or src and doc, etc. Then you only need to keep doing 'cd -' to toggle between them, as long as you are not going to any other dir in between.
For long dir paths that I cd to often, I sometimes define them as shorter shell env. vars. and add them to my .profile or equivalent startup file. Then I just do:
cd $short_dir_name_1 # or 2, etc.