File Exchange

image thumbnail

pushd, popd, and dirs

version 1.0.0.0 (1.93 KB) by Doug
Shortcuts for moving among directories, like Unix pushd, popd, and dirs commands.

1 Download

Updated 11 Jan 2012

View License

Ever find yourself using Matlab and wishing you could quickly get back to the directory you were just in? Or the one before that? Ever wish the Unix commands pushd, popd, and dirs were implemented in Matlab? Here they are.

Use pushd like cd. The only difference: every time you use pushd, the directory you leave behind is saved on a stack. To go back, just type popd, and it takes you to the directory on top of the stack. To see what's on the stack, use dirs. Stack size is not limited.

Type "help pushd", "help popd", or "help dirs" at the Matlab command line for more information.

Cite As

Doug (2020). pushd, popd, and dirs (https://www.mathworks.com/matlabcentral/fileexchange/34535-pushd-popd-and-dirs), MATLAB Central File Exchange. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux