Print the directory stack, showing the current directory first. See also popd and pushd.
Clear the directory stack.
Expand the home directory symbol (~) to the actual directory name.
Print one directory per line.
Re-create stack from file, which should have been created by dirs -S file.
Print to file a series of pushd and popd commands that can be invoked to replicate the stack.