"cd nov dec" That's the cd shuffle!
AnthonyEnglish 270000RKFN Comment (1) Visits (6546)
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 /pro
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:
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:
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.