pushd

Save and then change the current directory. With no arguments, pushd exchanges the top two directories.

Syntax
 pushd [dir | +N | -N] [-n]
Key
 +N Brings the Nth directory (counting from the left of the list printed by dirs,
 starting with zero) to the top of the list by rotating the stack.
 
 -N Brings the Nth directory (counting from the right of the list printed by dirs,
 starting with zero) to the top of the list by rotating the stack. 
 -n Suppresses the normal change of directory when adding directories to the 
 stack, so that only the stack is manipulated. 
 dir Makes the current working directory be the top of the stack, and then executes 
 the equivalent of 'cd dir'. cds to dir.

This is a BASH shell builtin, to display your local syntax from the bash prompt type: help pushd

#Ah, push it - push it good
Ah, push it - p-push it real good# ~ Salt 'N' Pepa

Related Linux commands

dirs - Display list of remembered directories.
popd - Restore the previous value of the current directory saved by PUSHD.
Equivalent Windows command: PUSHD - Save and then change the current directory.

(追記) (追記ここまで)
Copyright © 1999-2026 SS64.com
Some rights reserved

AltStyle によって変換されたページ (->オリジナル) /