disown was completely new to me. 25 years of Unix professionally and I’m still surprised (if more often horrified).
I’ve always used nohup for this.
Issue with nohup is that you have to know you want to nohup the thing BEFORE invoking it.
Disown lets you retroactively do this, which is a win for people who aren’t always as mindful as they should be about long running process states :)
Me too, but the idea that you can disown something that’s already running is neat.
Ditto - I’ve always used nohup and don’t recall encountering disown before. Interestingly, it’s apparently a shell builtin in ksh93 too (as well as bash since 2.0 and zsh). I’m not sure when it was added to ksh93, but bash 2.0 was released in November 1996. Yikes.
I read this expected some basics but some of it was new to me, such as pushd/popd. Good writeup.
I remembered those from your comment, and was kind of expecting more. Recommend checking it out, it’s a fast read for anyone who knows this stuff, and useful to anyone else.
disown was completely new to me, wonder if zsh has it ;)
[Comment removed by author]
cd - is actually very useful every time you work in a path location but a build, or something, you invoke elsewhere may remove and recreate the directory. Like with tmux panes, one for build and one for messing around.
cd - && cd -
While I don’t use cd - that often I was quite happy to learn that git checkout - behaves the same but for branches. Also, have a look at ripgrep (discussed here).
git checkout -
One nice thing not mentioned with the export HISTCONTROL=ignoreboth:erasedups setting is that along with ignoring duplicates (ignoreboth is shorthand for ignoredups and ignorespace) anything you type on the command line with at least one leading space will not be saved in your bash history - this is useful when you have to enter sensitive information like passwords as an option to a command.
Interesting article, like many here I didn’t know about disown.
To avoid the arrow keys, if you’re already a vi/vim user, it might be easier to set the bash vi option to on (set -o vi). You then have the modes as in vim, and pressing escape lets you use hjkl (so you can use k and j to move in your history), 0 to go to beginning of the line, $ for the end, move around words with w or e or b, etc. Pressing v brings your $EDITOR to edit the line.
set -o vi