commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Use this if you don't have access to GNU grep's -B option.
Don't have GNU tar installed that supports the redirect option (-C)? Use this.
Oracle DBA remove some logfiles which are still open by the database and he is complaining the space has not been reclaimed? Use the above command to find out what PID needs to be stopped. Or alternatively recover the file via:
cp /proc/pid/fd/filehandle /new/file.txt