.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "PUSHD" "1" "Nov 13, 2025" "4.2" "fish-shell" .SH NAME pushd \- push directory to directory stack .SH SYNOPSIS .nf \fBpushd\fP \fIDIRECTORY\fP .fi .sp .SH DESCRIPTION .sp The \fBpushd\fP function adds \fIDIRECTORY\fP to the top of the \fI\%directory stack\fP and makes it the current working directory. \fI\%popd\fP will pop it off and return to the original directory. .sp Without arguments, it exchanges the top two directories in the stack. .sp \fBpushd +NUMBER\fP rotates the stack counter\-clockwise i.e. from bottom to top .sp \fBpushd \-NUMBER\fP rotates clockwise i.e. top to bottom. .sp The \fB\-h\fP or \fB\-\-help\fP option displays help about using this command. .SH EXAMPLE .INDENT 0.0 .INDENT 3.5 .sp .EX cd ~/dir1 pushd ~/dir2 pushd ~/dir3 # Working directory is now ~/dir3 # Directory stack contains ~/dir2 ~/dir1 pushd /tmp # Working directory is now /tmp # Directory stack contains ~/dir3 ~/dir2 ~/dir1 pushd +1 # Working directory is now ~/dir3 # Directory stack contains ~/dir2 ~/dir1 /tmp popd # Working directory is now ~/dir2 # Directory stack contains ~/dir1 /tmp .EE .UNINDENT .UNINDENT .SH SEE ALSO .INDENT 0.0 .IP \(bu 2 the \fI\%dirs\fP command to print the directory stack .IP \(bu 2 the \fI\%cdh\fP command which provides a more intuitive way to navigate to recently visited directories. .UNINDENT .SH COPYRIGHT fish-shell developers .\" Generated by docutils manpage writer. .