Home OS X
OS X Syntax

pushd

Save the value of the current directory.

SYNTAX
      pushd [-p] [-l] [-n|-v] [name|+n]

OPTIONS

  name         Push the current working directory onto the directory stack
	       and change to name.
	       If name is `-' it is interpreted as the previous working directory
	       (see Filename substitution)

   +n           With a number `+n', rotates the nth element of the directory stack
               around to be the top element and changes	to  it.

   -p          Always print the final directory stack (overrides pushdsilent)

   -l, `~' or `~name'
	       Output is expanded explicitly to home or the pathname of the home
	       directory for user name.   

   -n          Entries are wrapped before they reach the edge of the screen.

   -v          Entries are printed one per line, preceded by their stack
	       positions. If both -n and -v are given, -v takes precedence.

   -p          Is accepted but does nothing.
	       	 

Environment variables
Without arguments, pushd will exchange the top two elements of the directory stack. If pushdtohome is set, pushd without arguments does `pushd ~', like cd..

If dunique is set, pushd removes any instances of name from the stack before pushing it onto the stack.

If dextract is set, `pushd +n' extracts the nth directory, pushes it onto the top of the stack and changes to it.

If the pushdsilent shell variable is set , suppress printing of the final directory stack.

pushd is a tcsh shell command.


"Fear is the greatest salesman" - Robert Klein

Related commands:

popd - Restore the previous directory

Equivalent BASH command:

pushd
- Save the value of the current directory.



Back to the Top

Simon Sheppard
SS64.com