commandlinefu.com is the place to record those command-line gems that you return to again and again.
Delete that bloated snippets file you've been using and share your personal repository with the world. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.
If you have a new feature suggestion or find a bug, please get in touch via http://commandlinefu.uservoice.com/
You can sign-in using OpenID credentials, or register a traditional username and password.
First-time OpenID users will be automatically assigned a username which can be changed after signing in.
Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.
Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):
Subscribe to the feed for:
Generated XML files often are poorly formatted. Use this command to properly indent and normalize the file in-place.
converts non-ISO dos text files for use on unix systems.
...changes modify time and access time. also:
touch -r [file1] [file2] # make file2 timestamp match file1
tar's directory and sends to netcat listening on port 10000
On the client end:
netcat [server ip] 10000 | tar xfvz -
This will send it over the network and extract it on the clients machine.
shows which shared lib files are pointed to by the dynamic linker.
Must be done as root - will cause subsequent ssh connections to use the identities available via the [user]'s agent socket.
Replaces A with B in binary file "orig" and saves the result to "new". You must have the hex representations of A & B. Try od: echo -e "A\c" | od -An -x
Useful when you're trying to unmount a volume and other sticky situations where a rogue process is annoying the hell out of you.
Scan pages in, clean them up in an image editor, save to individual files. Use this command to convert each page to PDF. Combine in Acrobat Professional, and use the built-in OCR with the "Searchable Image (Exact)" option. Gives excellent image quality and file size (avoids awful JPEG image recompression that Acrobat and other OCR systems tend to do.)
Use this to turn a page with snippets of equations into vector paths that Adobe Illustrator can handle without choking on font embedding and substitution issues. Good for keeping fonts consistent when labeling charts and diagrams. Also good for embedding formulas into diagrams.
prompts for a search term and then pulls down the first result from google images
If you use Mac OS X or some other *nix variant that doesn't come with ssh-copy-id, this one-liner will allow you to add your public key to a remote machine so you can subsequently ssh to that machine without a password.
shows all RPMs with files in the current directory & its subdirectories.
deletes logs not modified in over [#] days - modify to compress or move, as needed
changes THIS to THAT in all files matching fileglob* without using secondary files
Alternatively, if your password can contain a richer character set, try using 'uuencode' rather than base64.
dd if=/dev/urandom bs=16 count=1 2>/dev/null | uuencode -
Sample of that: '0:.CF\-@"\`W315VG^4O\.@``'
For some of my web servers I setup and configure, for scaling I use the httpd.conf settings for these. Sometimes I forget which servers are prefork and which are worker MPM, so I use this to remind myself.
mount -t msdos -o loop ./floppy.img /tmp/mnt
...if you get a certificate back, the server is accepting weak SSL ciphers