I know there is probably no simple way to do this, but I thought I might put this out there. I have a directory that contains a subdirectory for each customer I deal with. I’d like to be able to type that customers directory name in, anywhere on the computer, and switch to that directory. In other words:
/dir/customers/
/dir/customers/customer1/
/dir/customers/customer2/
/dir/customers/customer3/
I’d like customer1, customer2, and customer3 to all be added to my ~/.bashrc file, and whenever I create a new customer, it would update to add that as well.
Any takers?
If you add this code in your ~/.bashrc:
It will setup aliases for customer1, customer2, customer3 (all the sub directories of /dir/customers/) and every time you add a new customer (eg: customerN) it’s alias customerN will be added automatically you log in.
eg: alias customer1 is cd /dir/customers/customer1 and alias customer2 is cd /dir/customers/customer2 so on…