I learned the other day about a neat shortcut for tilde expansion in bash.
$ ls ~-/
The neat thing about this expansion is that it does tab completion. What this lead me to discover is that you can also do ~N, where n is a number refering to your directory stack. (the bash man page says you can use the command `dirs’ to view the stack, but it doesn’t seem to work for me. When you put in a 0 (zero), it is the current working dir. Combined with tab completion, this gave me a great way for creating symlinks. Before, I had to do something like
$ ls`pwd`/
Which does do tab completion. But if you want to save a whopping 3 key strokes!, you can do something like this:
quick(er) way to symlink your `pwd`
I learned the other day about a neat shortcut for tilde expansion in bash.
The neat thing about this expansion is that it does tab completion. What this lead me to discover is that you can also do ~N, where n is a number refering to your directory stack. (the bash man page says you can use the command `dirs’ to view the stack, but it doesn’t seem to work for me. When you put in a 0 (zero), it is the current working dir. Combined with tab completion, this gave me a great way for creating symlinks. Before, I had to do something like
Which does do tab completion. But if you want to save a whopping 3 key strokes!, you can do something like this:
Guide spidered from here.