5 ms·
Weird, my Ubuntu 20 install does not have man pages on pushd and popd. Are these commands be specific to bash? Anyway, since we are on the topic of directory n
by LeonM 6y ago
Weird, my Ubuntu 20 install does not have man pages on pushd and popd. Are these commands be specific to bash?
Anyway, since we are on the topic of directory navigation, I'd like to introduce 'cd -' (toggle to previous dir). Thank me later :-)
- c2xlZXB5Cg 6y agohttps://www.youtube.com/watch?v=BJ0uHhBkzOQ https://www.youtube.com/watch?v=BJ0uHhBkzOQ First example: type -a <something> to discover what <something> is (or if it exists on your system)
- roryrjb 6y agoThey are bash built-ins. They are documented in bash's man page.
- asicsp 6y agocan also use `help pushd` to get manual only for that command ('help' is like 'man' for built-ins)
- LeonM 6y agoThis is what I needed. None of the man pages showed information on the bash functions. 'help' did the job. Ironically, 'man help' yields no results.
- joombaga 6y agoThat's because `help` is also builtin. It's listed under "SHELL BUILTIN COMMANDS" in `man bash 1` (or use the non-obvious `help help`)
- Fnoord 6y agoThey are shell-specific, yes. Fish also has it built-in. Try man -a {pushd,popd} you can also use the man -k flag to find manpages, and see man man (or man --help) for more flags.
- rgrau 6y agozsh also has them. Another neat way of wrapping code in pushd/popd is to use a subshell. (cd $dir do-stuff ) Oilshell ( https://www.oilshell.org/ https://www.oilshell.org/ ) has support for code blocks so you can: cd /tmp { do-stuff }
- yipbub 6y agoGet docs for shell builtins with help. Eg: `help pushd`