Tips and Tricks - 2
Well, it's been a while since I posted the first Tips and Tricks article. Most of the following stuff was gathering dust (of the digital kind) ;-), waiting to be formalized into a post. So, I finally took pity of it and came up with this post.
1. Handling zombie processes
To reap (can't kill a zombie) a stubborn zombie process, you can do either of the following:
Using kill, send SIGCHLD (signal number 17 on Linux) to the parent of the zombie.
Send SIGCONT (signal number 18 on Linux) to the zombie process itself.
2. Safer output redirection in Bash
To prevent files from being overwritten by any redirection operator such as
<>, put either of the following in your ~/.bashrc:
set -o noclobber -- or -- set -C
This can help you from accidentally overwriting files. If you decide that you do want to go ahead with the operation, you can use the
>| operator instead.