Ability to easily switch between directories in different areas
For exactly two directories, use cd -
$ cd /tmp
$ cd /var/tmp
$ cd -
/tmp
$ cd -
/var/tmp
$ cd -
/tmp
$
Is there anyway I can assign some kind of short name to each one
Yes of course, with the alias
command:
alias directoryA='cd /path/to/directoryA'
Then use directoryA
as an alias for your cd
command. It's really that straightforward ;)
I would use shell variables:
da=/really/long/path/to/directory/a
db=/other/really/long/path/to/directory/b
cd $da
cd $db
The advantage of this method is that you can use $da and $db in place of file paths in any command, for example:
cp $da/file1 $db/file2