popd (built-in Bash command)

Content

 

Data

License: GNU GPLv3 +
Version number: GNU Bash 5
Developer / owner: Free Software Foundation Inc.

Short description:

The manual page and help for the popd built-in Bash command. The popd command removes a directory from the directory stack. Without arguments, it removes the top-level directory from the directory stack and sets the new working directory to the extracted item. If the popd command is successful, then one say command is also executed and returns 0.

The directory stack is a say can be displayed with the command, and pushd command to add a new directory.

 

 

Man page output

man bash
[...]
       popd [-n] [+n] [-n]
              Removes  entries  from the directory stack.  With no arguments, removes the top di-
              rectory from the stack, and performs a cd to the new top directory.  Arguments,  if
              supplied, have the following meanings:
              -n     Suppresses the normal change of directory when removing directories from the
                     stack, so that only the stack is manipulated.
              +n     Removes the nth entry counting from the left of  the  list  shown  by  dirs,
                     starting  with  zero.  For example: ``popd +0'' removes the first directory,
                     ``popd +1'' the second.
              -n     Removes the nth entry counting from the right of the  list  shown  by  dirs,
                     starting  with  zero.   For example: ``popd -0'' removes the last directory,
                     ``popd -1'' the next to last.

              If the popd command is successful, a dirs is performed as well, and the return sta-
              tus  is  0.   popd returns false if an invalid option is encountered, the directory
              stack is empty, a non-existent directory stack entry is specified, or the directory
              change fails.
[...]

 

 

Help output

popd --help
popd: popd [-n] [+N | -N]
    Könyvtárak eltávolítása a veremből.
    
    Elemeket vesz ki a könyvtárveremből. Argumentumok nélkül kiveszi a
    legfelső elemet, és a kivett elemre állítja az új munkakönyvtárat.
    
    Kapcsolók:
      -n        Ne váltson könyvtárat eltávolításkor, vagyis csak a vermet
                változtassa.
    
    Argumentumok:
      +N        Eltávolítja az N-edik elemet a „dirs” által kiírt listán,
                nullától, balról számolva. Pl. a „popd +0” az első, míg a
                „popd +1” a második könyvtárat távolítja el.
      -N        Eltávolítja az N-edik elemet a „dirs” által kiírt listán,
                nullától, jobbról számolva. Pl. a „popd -0” az utolsó,
                a „popd -1” az utolsó előtti könyvtárat távolítja el.
    
    A „dirs” beépített parancs listázza a könyvtárvermet.
    
    Kilépési kód:
    Sikerrel tér vissza, kivéve érvénytelen argumentum vagy könyvtárváltás
    során történő hiba esetén

 

Related Content