Fact-checked by Grok 2 weeks ago

pushd and popd

pushd and popd are shell builtin commands used in Unix-like operating systems to manage a directory stack, a last-in, first-out (LIFO) list of previously visited directories that facilitates quick navigation between multiple locations without repeatedly typing full paths. These commands allow users to "push" the current directory onto the stack while changing to a new one with pushd, and "pop" the top directory from the stack to return to a previous location with popd. Originating as an innovation in Bill Joy's C shell (csh) released in 1978 at the University of California, Berkeley, they provide a more efficient alternative to the basic cd command for workflows involving frequent directory switches, such as development or system administration tasks. The directory stack is maintained as an array in the shell's environment, with the current working directory always at the top (position 0), and its contents can be viewed using the related dirs builtin. In practice, pushd without arguments rotates the top two entries, effectively swapping directories, while specifying a path like pushd /home/user/docs adds that path to the top and changes to it; conversely, popd without arguments removes and returns from the top entry. In Bash, for example, both commands support options such as -n to suppress the directory change (manipulating the stack only), +N to rotate or remove the Nth entry from the left (0-based), and -N for the Nth from the right. If the underlying cd operation in pushd fails (e.g., due to permissions or non-existence), the command returns a non-zero exit status without modifying the stack. These builtins are implemented in popular shells including , Zsh, Korn shell (ksh), and (an enhanced csh), with slight variations in behavior or options across implementations. For instance, in , the stack is stored in the DIRSTACK array variable, which can be directly manipulated but requires pushd and popd for additions and removals to ensure consistency. By enabling stack-based , pushd and popd enhance shell interactivity, particularly in scripts or interactive sessions where maintaining context across directories is essential, and they remain a standard feature in modern environments as of 2025.

Example Usage

$ pwd
/home/user
$ pushd /tmp
/tmp /home/user
$ pwd
/tmp
$ popd
/home/user
$ pwd
/home/user
This sequence demonstrates pushing /tmp onto the , changing to it, and popping back to /home/user, with dirs output shown inline after pushd.

Overview

Purpose and Functionality

The pushd and popd commands are builtins designed to enhance directory navigation by maintaining a dynamic list of previously visited directories known as the directory . Specifically, pushd saves the current onto the and then changes the 's to a newly specified , effectively recording the transition for later retrieval. In contrast, popd removes the topmost entry (the current directory) from the and changes the current to the new top entry, allowing users to revert to a seamlessly. This mechanism operates on a last-in, first-out (LIFO) , akin to a physical of items where the most recently added element is the first to be removed, providing an intuitive way to track and cycle through directory history without path recollection. The primary benefits include enabling rapid reversion to earlier directories, which eliminates the need to retype lengthy paths during interactive sessions or scripted workflows, thereby improving efficiency in tasks involving frequent location changes. Such functionality is particularly valuable for temporary detours in , as it preserves a breadcrumb trail of locations to prevent disorientation in complex directory structures.

Directory Stack Mechanism

The directory stack is an internal in compatible shells, implemented as a list or (such as the dirstack in C shell derivatives), that maintains a record of the current and previously visited paths to facilitate navigation. This LIFO (last-in, first-out) structure allows the shell to track directory history without relying on external files or environment variables, enabling efficient during sessions, with the top element always the current . The pushd operation adds the new to the top of the after changing to it (effectively pushing the old current below). In contrast, popd removes the top entry (current ) from the and navigates the to the new top location. These operations ensure the always reflects the sequence of changes, with the top representing the current . To illustrate the mechanism, assume an initial state where the contains the current directory /home:
Stack: [/home]
Current: /home
Executing pushd /dir1 changes to /dir1 and updates the :
Stack: [/dir1, /home]
Current: /dir1
A subsequent pushd /dir2 changes to /dir2 and updates the :
Stack: [/dir2, /dir1, /home]
Current: /dir2
Finally, popd removes /dir2 from the top, navigates to /dir1, and leaves the as:
Stack: [/dir1, /home]
Current: /dir1
This visualization demonstrates the stack's role in preserving directory order for reversible navigation. In modern shells such as and , the directory stack size is typically unlimited, constrained only by available and the shell's capacity.

History

Origins in C Shell

The and commands originated in the (csh), developed by in 1978 while he was a graduate student at the , as part of enhancements to the Berkeley Software Distribution (BSD) variant of Unix. These commands were motivated by the limitations of the Bourne shell's cd command, which only changed the current working directory without maintaining a history of previous locations, making it cumbersome for users to navigate complex directory hierarchies involving frequent back-and-forth traversals. By introducing a directory stack—a last-in, first-out (LIFO) data structure—pushd and popd enabled users to save, recall, and manipulate multiple directory paths efficiently, streamlining interactive sessions on early Unix systems. In the initial csh implementation, pushd accepted the syntax pushd [+n | dir], where dir specified a new directory to push onto the stack (and change to), and +n referenced a position in the existing stack for rotation or exchange; without arguments, it swapped the top two stack entries. Popd used the syntax popd [+n], removing the top stack entry (or the nth entry) and changing to the new top directory, with +n defaulting to the top if unspecified. The accompanying dirs command displayed the stack contents, using ~ as shorthand for the home directory and showing entries horizontally from top to bottom. Core features focused on basic stack manipulation—pushing directories, popping them, and viewing the —without more advanced options like explicit extraction or uniqueness enforcement, though the no-argument pushd provided rudimentary between the current and previous directories. The csh, incorporating pushd and popd, was first distributed in the 2BSD release in May 1979, marking an early milestone in BSD's evolution and contributing to the shell's adoption among Unix developers.

Adoption Across Shells

Following the introduction of pushd and popd in the C shell (csh), these commands were incorporated into , an enhanced extension of csh developed by Ken Greer at in the late 1970s. Tcsh retained the core directory stack functionality of pushd and popd while adding significant improvements, including command-line editing, file name completion, and job control enhancements that integrated seamlessly with the stack operations. The Bourne Again Shell (bash), created by Brian Fox for the GNU Project and first released in version 1.0 in 1989, adopted and as built-in commands from its initial release. Bash expanded their capabilities with options such as -n for , which adds a directory to the without changing the current , and support for rotating the using +n or -n arguments, making them more versatile for scripting and interactive use. (zsh), developed by Paul Falstad and first released in 1990, integrated and from its early versions, maintaining compatibility with csh syntax while introducing unique features like named directories (e.g., ~name aliases) that could interact with the directory for advanced navigation. Zsh's implementation also supports options for silent operation and rotation, enhancing its appeal for users migrating from csh or . In other shells, support varied but contributed to broader adoption. (ksh), originally developed by David Korn in 1983, did not include pushd and popd as built-ins in its early versions but provided them as loadable functions in later variants and distributions, such as pdksh and those in modern Unix systems (e.g., via /usr/share/ksh/functions/pushd). The shell, introduced in 2005, offers built-in pushd and popd commands with syntax aligned to traditional usage, though its primary directory navigation emphasizes a separate history-based stack via cdh, prevd, and nextd for interactive workflows. By the 1990s, pushd and popd had become widespread in non-POSIX shells across Unix-like environments, improving directory management portability despite their absence from the POSIX.2 shell standard.

Usage in Unix-like Systems

pushd Syntax and Options

The pushd command in Unix-like systems is a shell builtin that adds a directory to the top of the directory stack and changes the current working directory to it, or rotates the stack without changing directories depending on the arguments provided. The basic syntax is pushd [-n] [+N | -N | dir], where dir specifies the target directory path to push onto the stack, +N rotates the stack so the Nth entry (counting from the left, starting at 0) becomes the top, and -N rotates so the Nth entry from the right becomes the top. If no argument is given, pushd exchanges the top two entries on the stack, effectively swapping the current and previous directories. The -n option suppresses the directory change, allowing the stack to be manipulated without altering the current ; this is useful for scripting or maintaining stack independently. In shells like , pushd relies on the cd builtin for directory changes unless -n is specified, and it returns a non-zero if the cd fails, the stack is empty, or an invalid N is provided. Errors occur if the specified dir is invalid or inaccessible, preventing the push operation. Upon successful execution, pushd typically displays the updated directory stack using the dirs command in interactive mode, providing a visual confirmation of the stack's state; this output can be suppressed in some configurations but is standard behavior unless quiet mode is enabled via options like -q in Zsh. In Zsh, the syntax extends to pushd [-qsLP] [arg] for pushing or swapping, pushd [-qsLP] old new for substituting strings in the current directory path before pushing, and pushd [-qsLP] {+ | -} n for rotation, with additional options like -q for quiet operation (skipping stack print and hooks), -s to avoid symlinks, and -L or -P to control handling. The pushd command is not part of the POSIX standard shell specification, which only requires basic cd functionality; the minimal portable form pushd dir may work in extended shells but is not guaranteed across all POSIX-compliant environments. Extensions such as rotation operators (+n and -n) and the -n option are shell-specific, with variations between Bash (which emphasizes POSIX-like mode toggles) and Zsh (which includes path substitution and option-driven behaviors like PUSHD_MINUS for flipping rotation direction). As a complementary operation to popd, which removes directories from the stack, pushd enables efficient navigation by maintaining a LIFO structure.

popd Syntax and Options

The popd command in systems removes entries from the directory stack, a list of previously visited directories managed by the shell, and typically changes the current working directory to the new top of the stack. Its basic syntax is popd [+n | -n], where the absence of arguments defaults to popping the top (most recently pushed) directory. When executed, popd changes to the directory that becomes the new top of the stack after removal and prints the updated stack contents, equivalent to running the dirs command. If the stack is empty or the specified index is invalid, it returns a non-zero and issues an error. Options for popd vary by shell but generally allow targeting specific positions in the stack. The +n option removes the nth entry counting from the left (starting at 0 for the top), while -n removes the nth entry from the right (starting at 0 for the bottom) in shells that support it; after removal, the shell changes to the new top unless suppressed. Unlike pushd, which can add directories without changing the current directory via a dedicated option, popd in most implementations does not inherently provide a way to remove without changing, though offers -n to suppress the directory change while still manipulating the stack. In scripts, popd interacts with pushd by relying on prior stack pushes; developers should check the (e.g., via $?) to handle cases like empty stacks or failed changes. Shell variations affect popd support: fully implements popd [-n] [+N | -N], where -n quiets the stack print and suppresses cd, enabling precise control over stack positions from either end. Zsh uses popd [ [-q] { + | - } n ], supporting left (+n) and right (-n) indexing with -q for quiet operation that skips printing and hook functions, but the meanings of + and - can swap if the PUSHD_MINUS option is set. In contrast, (csh) limits popd to popd [+n], discarding only from the left without right-indexing or suppression options, reflecting its simpler origins. These differences ensure compatibility but require awareness in cross-shell scripting.

Usage in Windows Environments

Command Prompt Implementation

The pushd and popd commands were introduced as internal commands in MS-DOS 5.0 in 1991 and remain available in the Windows Command Prompt (cmd.exe) for managing a directory stack to facilitate navigation between directories. The syntax for pushd is pushd [<path>], where <path> specifies the target directory, optionally including a drive letter as [drive:]<path>. When invoked without a path argument, pushd displays the current contents of the directory stack, with the most recent directory at the top, but does not perform a swap or other manipulation. Unlike more advanced shell implementations, it lacks options for stack indexing (such as +n or -n) or rotation; it simply pushes the current directory onto the stack and changes to the specified path if provided. The popd command has a simple syntax of popd with no arguments, which removes the top entry from the directory stack and changes the current directory to that location. It does not support any parameters for selective popping or other behaviors. Key features include support for Universal Naming Convention (UNC) paths and network drives; when command extensions are enabled (the default in modern Windows), pushd temporarily assigns an available drive letter (starting from Z: and decrementing) to a UNC path like \\server\share, allowing navigation as if it were a local drive, while popd removes the temporary mapping upon return. The directory stack operates on a last-in, first-out (LIFO) principle, enabling nested changes for scripting or manual use, and its contents can be viewed implicitly through repeated pushd invocations without arguments. Limitations include a historical on stack size tied to available memory in early implementations like , though larger in contemporary without a hard limit documented, the absence of rotation or indexing options for direct access to non-top entries, and no quiet mode to suppress output or stack display. Command extensions must be enabled for UNC path handling, and popd will fail if the is empty, returning to the current directory without change.

PowerShell Aliases

In Windows , pushd and popd serve as built-in aliases for the Push-Location and Pop-Location cmdlets, respectively, providing a familiar interface for managing directory stacks similar to traditional command-line tools. These aliases were introduced in 1.0, released in November 2006, to enhance compatibility for users transitioning from other shells while leveraging 's object-oriented framework. The pushd alias, equivalent to Push-Location, pushes the current onto a and changes the working to the specified . Its basic is pushd <path>, where <path> can include wildcards or be provided literally via the -LiteralPath to avoid interpretation. For advanced usage, the -StackName allows specifying or creating named stacks, enabling multiple independent stacks within a session, such as pushd HKLM:\Software -StackName RegStack. The -PassThru switch returns a object for further processing. Correspondingly, the popd alias, mapped to Pop-Location, removes the most recent location from the top of the stack and sets it as the current working location. Its syntax is simply popd, with optional -StackName to target a specific stack, like popd -StackName RegStack, and -PassThru to output the resulting location. These operations follow a last-in, first-out (LIFO) principle, maintaining stack integrity across invocations within the same session. PowerShell extends these aliases beyond basic file system navigation by supporting any registered provider, such as the Registry or Certificate store, allowing seamless switching between disparate data stores without syntax changes. For instance, pushd HKLM:\ navigates to the local machine registry hive. Stack contents can be viewed using Get-Location -Stack for the default stack or Get-Location -StackName <name> for named ones, displaying a list of paths in reverse order of addition. While preserving command-like brevity akin to earlier Windows environments, these aliases integrate with 's scripting capabilities, including support where the -Path of Push-Location accepts inputs from preceding commands, enabling chained operations like Get-ChildItem | Push-Location. Stacks are inherently session-scoped, but PowerShell profiles—user or system scripts executed at startup—offer optional customization for initializing or restoring common locations upon session launch. This combination facilitates both interactive use and automated workflows in administrative tasks.

Examples and Practical Applications

Unix-like Scenarios

In shells such as , Zsh, and Csh, pushd and popd facilitate efficient directory navigation by maintaining a of previously visited paths, allowing users to switch contexts and return without relying solely on absolute paths. A common simple navigation scenario involves temporarily moving to a and returning to the original location. For instance, starting from the , a user can execute pushd /tmp to add /tmp to the and change into it, perform tasks such as creating files or running temporary processes, and then use popd to remove /tmp from the and revert to the . This approach avoids manual path reconstruction and is particularly useful in interactive sessions where context switching is frequent. Stack rotation enables cycling through multiple directories without adding new entries, preserving the stack's order for repeated access. Consider a scenario with three directories: starting in /home, execute pushd /etc to add and switch to /etc, then pushd /var to add and switch to /var; the stack now holds /home, /etc, and /var (with /var as the current directory). In and Zsh, issuing pushd +1 rotates the stack by bringing the second entry (/etc) to the top, switching to /etc while reordering the stack to /etc, /var, /home (0-based indexing, +0 top, +1 second). In csh, the stack is 1-based (+1 top), so pushd +2 achieves the equivalent rotation. In scripting, pushd and popd promote maintainable code by isolating directory changes, reducing reliance on hardcoded paths that could break across environments. For example, in a build , pushd src changes into the source subdirectory to compile files (e.g., via make), followed by popd to return to the project root for subsequent steps like packaging; this ensures the script's remains consistent regardless of the invocation location. Such patterns are standard in and Zsh automation tasks, with Csh supporting equivalent stack-based navigation in scripts. Advanced usage includes options for non-disruptive management and robust handling. The -n with pushd -n /path adds a directory to the without changing the current , useful for bookmarking locations during complex workflows. Complementing this, dirs -v displays the with numbered entries (e.g., 0 /home\n1 /etc\n2 /var), aiding reference in interactive or scripted rotations like pushd +2. For reliability, scripts often check the post-operation, such as popd; if [ &#36;? -ne 0 ]; then echo "Stack empty or [error](/page/Error)"; fi, preventing failures if the is empty or the directory invalid. Zsh offers a quiet mode (e.g., -q for popd to suppress output and hooks), along with checks; csh provides checks but lacks a dedicated quiet option for these commands. A real-world application arises when editing system configurations from a user session, such as starting in /home/[user](/page/User) and using pushd /etc to switch for editing a file with vi config.conf, then popd to return to /home/[user](/page/User) without disrupting the primary workflow. This preserves session continuity, especially in administrative tasks across multi-user systems.

Windows Scenarios

In Windows Command Prompt (cmd.exe), the pushd and popd commands enable temporary navigation to directories for tasks like inspecting system files without altering the persistent current directory. For instance, to list contents in the Windows system directory and return, one can execute pushd C:\Windows, followed by dir to display files, and then popd to revert to the original location. This approach maintains workflow continuity, as the directory stack stores the prior path for restoration. A key application involves shares via Universal Naming Convention () paths, where pushd temporarily maps the share to an available drive letter (starting from Z: downward) if command extensions are enabled, allowing seamless access as a local drive. For example, pushd \\server\share maps the remote , enabling commands like copy file.txt . to transfer files, after which popd unmaps the drive and returns to the previous . This avoids permanent drive assignments, reducing administrative overhead for one-off operations. In batch scripting (.bat files), pushd and popd facilitate relative operations from the 's location using parameter expansions like %~dp0, which expands to the drive and path of the itself. A might include pushd "%~dp0" to switch to its , perform tasks such as for %f in (*.txt) do del "%f", and conclude with popd to restore the caller's context. This ensures portability across execution environments. PowerShell implements pushd as an alias for the Push-Location cmdlet and popd for Pop-Location, supporting multiple named s for complex navigation across providers like file systems or registries. To manage separate stacks, one can use pushd -StackName Temp C:\temp to push and switch to a temporary directory on the "Temp" , followed by pushd -StackName Proj D:\project on a different "Proj" , and selectively popd -StackName Temp to restore only the first without affecting the second. This multi- capability aids in isolated task handling, such as temporary file operations alongside project work. Paths containing spaces require enclosing in double quotes to prevent parsing errors in both and . For example, pushd "C:\Program Files" correctly navigates to the directory, allowing subsequent commands, while popd returns as usual; omitting quotes would treat "Files" as a separate , leading to failure. This quoting convention applies universally to avoid common pitfalls in path handling.

Implementation Differences

Syntax Variations

In Unix-like systems, such as those using , the pushd command supports a versatile syntax: pushd [dir | +n | -n], where dir specifies a (supporting relative or absolute paths with tilde expansion for the ), +n rotates the so that the nth entry (zero-based from the beginning) becomes the new top using the -n option to suppress the change (manipulating the only), and -n performs a similar from the nth entry counting from the end of the . In contrast, the Windows Command Prompt implementation uses a simpler syntax: pushd [<path>], accepting only an optional (relative paths are supported, but network paths require notation or drive letter substitution, and paths with spaces must be enclosed in quotes) with no support for indices like +n or -n. PowerShell's Push-Location cmdlet, aliased as pushd, extends this further with pushd [[-Path] <String>] [-PassThru] [-StackName <String>], allowing specification, optional output of the location object via -PassThru, and targeting named stacks via -StackName, but again without Unix-style indices. For popd in Unix-like environments, the syntax is popd [+n | -n], enabling removal of the nth entry from the stack's beginning (+n) or end (-n), followed by a change to the new top directory (unless using the -n option to suppress the directory change), and it typically prints the updated stack unless output is redirected. Windows Command Prompt restricts popd to a basic form: popd, with no arguments or indices, simply removing the top entry and changing to the previous directory without printing the stack. In PowerShell, Pop-Location (aliased as popd) uses popd [-PassThru] [-StackName <String>], supporting stack-specific pops via -StackName and optional output via -PassThru, but lacking positional removal options. These syntax differences affect argument handling: Unix-like shells expand tilde (~) in paths for resolution and handle relative paths flexibly, while Windows environments in Command demand explicit drive letters (e.g., C:\) or paths (e.g., \\server\share) for non-local directories, with required for paths containing spaces to prevent errors. Regarding output verbosity, Unix pushd and popd print the directory stack after operations (suppressible only via redirection, such as > /dev/null), whereas Windows Command versions perform silent directory changes without stack display, and remains non-verbose unless -PassThru is explicitly used. For cross-platform portability, scripts relying on basic forms like pushd <dir> followed by popd (without indices or advanced options) function consistently across Unix-like and Windows systems, though Unix-specific features like stack rotation remain incompatible.

Behavioral Distinctions

In shells such as , the pushd and popd commands automatically print the contents of the directory to after each successful , providing immediate feedback on the current state. In contrast, the Windows Command Prompt (CMD) implementation does not display the stack following a pushd or popd ; the directory is not displayed by pushd or popd. Similarly, PowerShell's Push-Location (aliased as pushd) and Pop-Location (aliased as popd) do not print the stack automatically, relying on Get-Location -Stack for display. Error handling differs notably between Unix-like systems and Windows environments. In Bash, popd invoked on an empty stack returns a non-zero exit status and outputs an error message such as "bash: popd: directory stack empty," allowing scripts to detect and respond to the condition via conditional checks. Likewise, pushd with an invalid or inaccessible path returns a non-zero exit status and an error message, halting further execution in non-interactive scripts unless suppressed. In Windows CMD, popd on an empty stack or pushd to an invalid path echoes an error message to the console (e.g., "The system cannot find the path specified") but sets the %ERRORLEVEL% environment variable without automatically terminating the command or batch script, enabling continuation unless explicitly checked with IF ERRORLEVEL. PowerShell offers more flexible error handling through common parameters like -ErrorAction Stop to throw terminating errors on failures, including empty stacks or invalid paths. Path resolution mechanisms vary across platforms, affecting how directories are interpreted. Bash expands the tilde (~) to the user's and substitutes variables (e.g., $[HOME](/page/Home)) during pushd and popd operations, facilitating portable path usage. In CMD, paths use substitution with %VAR% syntax (e.g., %USERPROFILE%), but lacks native tilde expansion, requiring explicit variable references for home directories; UNC paths are supported by temporarily assigning a virtual drive letter from Z: downward. PowerShell resolves paths using $env:VAR for s and supports ~ as an alias for $HOME in the FileSystem provider, with broader compatibility across providers like Registry or stores. The directory stack's scope is implementation-specific, impacting usability in multi-session workflows. In shells, the stack is maintained per shell instance, isolating it to the current and subshells unless explicitly exported or sourced. extends this by supporting named stacks via the -StackName parameter in Push-Location and Pop-Location, allowing multiple independent stacks within a single session for better organization, though stacks remain session-bound without external persistence mechanisms. CMD adheres to a single, unnamed stack per command session, without named stack support. Edge cases reveal further operational quirks. resolves symbolic links during path navigation in pushd, following the filesystem's default without built-in , which can lead to hangs in symlink loops similar to cd. In CMD, attempting pushd to a non-existent UNC path (e.g., \\invalid\share) fails with an but does not propagate the to halt batch execution unless %ERRORLEVEL% is checked, potentially allowing silent continuation in automated workflows.

References

  1. [1]
    Directory Stack Builtins (Bash Reference Manual) - GNU.org
    ... pushd uses the cd builtin to change to the directory at the top of the stack. If the cd fails, pushd returns a non-zero value. Otherwise, if no arguments ...
  2. [2]
    The Directory Stack (Bash Reference Manual)
    ### Summary of Directory Stack and Commands
  3. [3]
    How to Use pushd and popd on Linux - How-To Geek
    One of the innovations Bill Joy incorporated in his 1978 C Shell was the concept of a directory stack and the means to manipulate it: pushd and popd .
  4. [4]
    Moving Around the File System - Using csh & tcsh [Book] - O'Reilly
    pushd + n Rotate stack so entry n is on top popd Drop top entry and return to previous entry popd + n Drop entry n entry from stack (tcsh, some versions of csh).
  5. [5]
    Navigating the Bash shell with pushd and popd - Opensource.com
    Aug 7, 2019 · The pushd and popd commands are built-in features of the Bash shell to help you "bookmark" directories for quick navigation between locations ...
  6. [6]
    Pushd and Popd Commands in Linux
    Sep 21, 2019 · `pushd` saves a directory to a stack and changes to it, while `popd` removes the top directory from the stack and navigates to the new top.
  7. [7]
    Bash Reference Manual
    Summary of each segment:
  8. [8]
    csh(1) - Linux man page
    ... csh.cshrc and /etc/csh.login. It then executes commands from files in the ... Note that putting a cd, pushd or popd in cwdcmd may cause an infinite loop.
  9. [9]
    [PDF] An Introduction to the C shell - FreeBSD Documentation Archive
    ... pushd and popd to manipulate the contents of the directory stack and to ... popd. The popd command changes the shell's working directory to the directory you most.
  10. [10]
  11. [11]
  12. [12]
  13. [13]
    Bash Reference Manual
    Summary of each segment:
  14. [14]
    C shell Programming Language Information & Resources
    It has been widely distributed, beginning with the 2BSD release of the Berkeley Software Distribution (BSD) which Joy first distributed in 1978. Other early ...
  15. [15]
    Evolution of shells in Linux - IBM Developer
    Dec 9, 2011 · The C shell was developed for Berkeley Software Distribution (BSD) UNIX systems by Bill Joy while he was a graduate student at the University of ...
  16. [16]
    csh - FreeBSD Manual Pages
    CSH(1) General Commands Manual CSH(1) NAME csh - a shell (command interpreter) with C-like syntax SYNOPSIS csh [ -cefinstvVxX ] [ arg ... ] DESCRIPTION Csh ...
  17. [17]
    History of the Berkeley Software Distribution - Wikipedia
    The official 4.2BSD release came in August 1983. It was notable as the first version released after the 1982 departure of Bill Joy to co-found Sun ...
  18. [18]
  19. [19]
    Shell Command Language
    Summary of each segment:
  20. [20]
    pushd - push directory to directory stack - fish shell
    The `pushd` command adds a directory to the top of the directory stack, making it the current working directory. `popd` pops it off.
  21. [21]
    17 Shell Builtin Commands - zsh
    Directories are added to this stack with the pushd command, and removed with the cd or popd commands. If arguments are specified, load them onto the directory ...
  22. [22]
    zshbuiltins(1): zsh built-in commands - Linux man page
    The third form of pushd changes directory by rotating the directory list. An argument of the form '+n' identifies a stack entry by counting from the left of the ...
  23. [23]
    csh — a shell (command interpreter) with C-like syntax
    William Joy. Job control and directory stack features first implemented by J.E. Kulp of IIASA, Laxenburg, Austria, with different syntax than that used now.
  24. [24]
    DOS | The future belongs to those who prepare for it today
    ... released MS-DOS 5.0 in May 1990. This would be released in 1991 and include ... POPD Restore the previous value of the current directory saved by PUSHD•.
  25. [25]
    pushd | Microsoft Learn
    Feb 3, 2023 · Stores the current directory for use by the popd command, and then changes to the specified directory. Every time you use the pushd command, a single directory ...
  26. [26]
    Pushd - Change directory/folder - Windows CMD - SS64.com
    The `PUSHD` command changes the current directory and stores the previous path for use with `POPD`. Syntax: `PUSHD [drive]path`. If no drive/path is specified, ...
  27. [27]
    popd | Microsoft Learn
    Nov 1, 2024 · The popd command changes the current directory to the directory that was most recently stored by the pushd command.Missing: csh | Show results with:csh
  28. [28]
    Popd - Restore directory/folder - Windows CMD - SS64.com
    Change directory back to the path/folder most recently stored by the PUSHD command. POPD will also remove any temporary drive maps created by PUSHD Syntax POPD.Missing: csh | Show results with:csh
  29. [29]
    Using aliases - PowerShell - Microsoft Learn
    Jul 23, 2024 · PowerShell provides cmdlets for managing command aliases. The ... Pop-Location, popd. pwd, Get-Location, gl , pwd. pushd, pushd, Push-Location ...
  30. [30]
    Release history of modules and cmdlets - PowerShell | Microsoft Learn
    Jan 17, 2025 · This article lists the modules and cmdlets that are included in various versions of PowerShell. This is a summary of information found in the release notes.
  31. [31]
    Push-Location (Microsoft.PowerShell.Management)
    PowerShell includes the following aliases for Push-Location : All Platforms: pushd. PowerShell supports multiple runspaces per process. Each runspace has its ...Syntax · Path (Default) · Description
  32. [32]
    Pop-Location (Microsoft.PowerShell.Management)
    The commands use the pushd alias for Push-Location and the popd alias for Pop-Location . The first command pushes the current file system location onto the ...
  33. [33]
    Get-Location (Microsoft.PowerShell.Management)
    To display the locations in the current location stack, use the Stack parameter of the Get-Location cmdlet. To display the locations in a named location stack, ...Syntax · Description
  34. [34]
  35. [35]
  36. [36]
  37. [37]
    How to get my own path in a batch-file. - Microsoft Learn
    Jul 23, 2021 · Default answer is %~dp0. And most times this will work fine. But there is a bug in cmd.exe which will prevent this from working correctly ...
  38. [38]
    Long paths with spaces require quotation marks - Windows Server
    Jan 15, 2025 · Use quotation marks when specifying long filenames or paths with spaces. For example, typing the copy c:\my file name d:\my new file name ...
  39. [39]
    Push-Location (Microsoft.PowerShell.Management) - PowerShell
    ### Summary of Push-Location (pushd) and Pop-Location in PowerShell
  40. [40]
    Pop-Location (Microsoft.PowerShell.Management) - PowerShell
    ### Summary of Pop-Location Syntax and Behavior in PowerShell