popd
e pushd
são comandos embutidos no Bash, eles não são executáveis reais que vivem no seu HDD como verdadeiros binários.
DIRSTACK
An array variable (see Arrays below) containing the current
contents of the directory stack. Directories appear in the stack
in the order they are displayed by the dirs builtin. Assigning to
members of this array variable may be used to modify directories
already in the stack, but the pushd and popd builtins must be used
to add and remove directories. Assignment to this variable will
not change the current directory. If DIRSTACK is unset, it loses
its special properties, even if it is subsequently reset.
A lista completa de todos os comandos incorporados está disponível na página de manual do Bash e aqui - link .
Você também pode usar compgen -b
ou enable
para obter uma lista completa de todos esses recursos:
$ compgen -b | grep -E "^push|^pop"
popd
pushd
ativar
$ enable -a | grep -E "\bpop|\bpus"
enable popd
enable pushd
Além disso, se você quiser obter ajuda sobre os recursos internos, use o comando help
:
$ help popd | head -5
popd: popd [-n] [+N | -N]
Remove directories from stack.
Removes entries from the directory stack. With no arguments, removes
the top directory from the stack, and changes to the new top directory.
$ help pushd | head -5
pushd: pushd [-n] [+N | -N | dir]
Add directories to stack.
Adds a directory to the top of the directory stack, or rotates
the stack, making the new top of the stack the current working