popd

remove an element from the directory stack 

Command


SYNOPSIS

popd [+n]


DESCRIPTION

Remove an element from the current directory stack.

With no options, popd removes the top directory stack element and sets the current working directory to the directory name of the new top element.

Options

+n 

removes the n'th element in the directory stack. Stack elements are numbers starting at 0, with 0 being the top element. For example, to remove the second element in the current directory stack, you would specify

popd +1


DIAGNOSTICS

Possible exit status values are:

0 

Successful completion.

1 

When no options are given and the current working directory could not be set to the 2nd element on the stack (for example, it no longer exists). The value of n is larger than the number of elements on the stack.


PORTABILITY

Windows 8.1. Windows Server 2012 R2. Windows 10. Windows Server 2016. Windows Server 2019. Windows 11. Windows Server 2022.


NOTE

popd is a KornShell function defined in the file

$ROOTDIR/etc/dir.ksh.

This file is normally processed by a login shell during the processing of the file $ROOTDIR/etc/profile.ksh. If your system fails to recognize the popd command, check your profile.ksh file to ensure that a call to dir.ksh is included.


AVAILABILITY

PTC MKS Toolkit for Power Users
PTC MKS Toolkit for System Administrators
PTC MKS Toolkit for Developers
PTC MKS Toolkit for Interoperability
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Commands:
dirs, gdir, pushd

Using the MKS KornShell


PTC MKS Toolkit 10.4 Documentation Build 39.