LinuxCommandLibrary

pop

Remove top value from stack

TLDR

Pop value from stack (Forth)

$ pop
copy
Pop in dc calculator
$ echo "1 2 3 R p" | dc
copy

SYNOPSIS

pop [options]

DESCRIPTION

pop removes and discards the top value from a stack. It is a fundamental operation in stack-based programming languages and calculators like Forth and dc.
In shell contexts, the related command popd performs a similar operation on the shell's directory stack. The pop operation is the complement of push.

PARAMETERS

Stack operation command.

CAVEATS

Context-dependent. Part of stack-based languages.

HISTORY

pop is a fundamental stack operation in computer science.

SEE ALSO

dc(1), forth(1), pushd(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community