A. Nothing, but it still looks weird
The cd shuffle
Have you ever used the cd shuffle? It lets you switch between an old directory and a new one when the two directory paths have only a single string different. It's like a single search and replace in your current path, and then cd to the new directory. Here's an extract from an article I've written (Up and down the directory tree) about that most basic of Unix commands, cd.
The cd shuffle takes two parameters. The first is the string you want to replace in the current directory path. The second parameter is the replacement string. For example, to move from the directory /programs/v7/reports/monthly to /programs/v8/reports/monthly, you just type in cd v7 v8, as you can see here:
/programs/v7/reports/monthly > cd v7 v8
That single command has saved 19 keystrokes! That's much simpler than going up three parent directories, and then heading back down the directory tree, or using the absolute path.
This two parameter cd command has lots of uses: swapping between similar directory paths where the only difference is:
- a database instance name
- a branch name
- or maybe a date.
Squiggles, dashes and the absolute low down on relative paths
The article also looks at relative and absolute paths, and how to toggle back and forth between two directories using the cd dashback:
/home/anthony > cd /usr/sys/inst.images
/usr/sys/inst.images > cd -
I also cover the use of the tilde (~) to refer to the home directory of a user. (Hey, that squiggle key has to be useful for something).
You might find a tip or trick about the cd command that will help you in your work, especially if you're a little new to Unix or in need of a refresher. Even if you're an old hand, perhaps you'll find something to impress your friends at those exciting geek parties we all like being invited to.
If you want to get more out of the cd command, have a read:Up and down the directory tree.