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:
Does an in situ search-replace but leaves a datestamped backup. A variation with more precision:
sed -i.`date +%Y%m%d%H%M%S 's/pattern/replace' [filename]
customizable context searches - if you know sed, this is a basis for more complex context control than grep --context offers
...can do similar w/ tar, dd, xfsdump, e2fsdump, etc.
fuser 25/tcp (see which pid is listening on smtp)
a pkcs8 key will have integer 00 at offset 4 and an rsaEncryption object at offset 9
changes group ownership of all files/dirs in /path/to/dir to a project group [projgroup] and then gives the sgid bit to directories in that tree - all subsequently created files will inherit [projgroup]'s gid.
useful if you want to start running a svc as a non-privileged user instead of root.