Archive for 'UNIX'

How to undelete any open, deleted file on linux / solaris

Chris Dew wrote up a neat trick on how to recover files if deleted on Linux, yet still open by a process. This works on Solaris as well.  =) $:~:uname -a SunOS somehost.com 5.10 Generic_127112-11 i86pc i386 i86pc $:~:echo “sup prefetch.net folks?” > testfile $:~:tail -f testfile & [1] 17134 $:~:rm testfile $:~:ls /proc/17134/fd/ 0  […]

Cron format

I’ve been cleaning out a bunch of super old notes this week, and am going to post them on my blog for future reference. In case I incur a head injury and need to memorize the crontab format again, here it is as ascii art: minute (0-59), | hour (0-23), | | day of the […]

Why SIGHUP?

Earlier this week I sent a SIGHUP signal to a process to get it to reread it’s configuration file. Of all the signals that could have been chosen to perform this action, why SIGHUP? Well — the answer to this question comes on page 267 of Advanced Programming in the UNIX Environment 1st edition: “This […]