Any Bash features you'd like to see?
Chris F.A. Johnson
cfaj-uVmiyxGBW52XDw4h08c5KA at public.gmane.org
Fri May 13 13:33:47 UTC 2005
On Fri, 13 May 2005, Scott Allen wrote:
> On Thu May 12,2005 02:22:58 PM William Park wrote:
>> 2. To go back even more, search the history buffer for 'cd '. In
>> vi-mode command-line, it is
>> /cd
>
> This doesn't work if various commands are used to change directories in
> addition to cd, such as pushd, popd, aliases, custom commands. I still think
> a separate directory history, like what pushd/popd keeps, but with random
> access, would be nice.
You already have random access with popd:
popd: popd [+N | -N] [-n]
Removes entries from the directory stack. With no arguments,
removes the top directory from the stack, and cd's to the new
top directory.
+N removes the Nth entry counting from the left of the list
shown by `dirs', starting with zero. For example: `popd +0'
removes the first directory, `popd +1' the second.
-N removes the Nth entry counting from the right of the list
shown by `dirs', starting with zero. For example: `popd -0'
removes the last directory, `popd -1' the next to last.
-n suppress the normal change of directory when removing directories
from the stack, so only the stack is manipulated.
You can see the directory stack with the `dirs' command
--
Chris F.A. Johnson <http://cfaj.freeshell.org>
==================================================================
Shell Scripting Recipes: A Problem-Solution Approach, 2005, Apress
<http://www.torfree.net/~chris/books/ssr.html>
--
The Toronto Linux Users Group. Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml
More information about the Legacy
mailing list