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:
Check if you have 64bit by looking for "lm" in cpuinfo. lm stands for "long mem". This can also be used without being root.
Get a list of all the unique hostnames from the apache configuration files. Handy to see what sites are running on a server. A slightly shorter version.
Get a list of all the unique hostnames from the apache configuration files. Handy to see what sites are running on a server.
A quick way of know the temperature info.
The command shows the real power of the pdftk tool, you can do basically everything you want with multiple pdf's.
In the command a book is created from chapters, headings and covers.
when someone mail you his ssh public key, and the lines are broken with '\n', you can reconstruct a new file with one key by line with this command.
I think I picked this one up from Hak5 (yeah I know.. kinda lame)
if you, like me, do not have the numsum, this way can do the same.
I must monitorize a couple of ftp servers every morning WITHOUT a port-scanner
Instead of ftp'ing on 100 ftp servers manually to test their status I use this loop.
It might be adaptable to other services, however it may require a 'logout' string instead of 'quit'.
The file ftps.txt contains the full list of ftp servers to monitorize.
Get Memeory Info
Col 1 is swapped sum in kb
Col 2 is pid of process
Col 3 is command that was issued
i wanted to delete all duplicate lines from .bash_history and keep the order of the other lines.
the command cat's the file and adds line numbers, then sorts by the second column. afterwards uniq omits repeated lines, but skips the first field (the line number). then it sorts by the line numbers and at the end cuts the numbers off.
cat - concatenate MP3 files and save it...
Searches all log files (including archived bzip2 files) for invalid user and PAM authentication errors, both of which are indicative of brute force attempts at logging into computer. A list of all unique IP addresses and domain names is appended to hosts.deny. The command (and grep error messages) will work on Mac OS X 10.6, small adjustments may be needed for other OSs.
This should work on any unix platform running bash. Just type the program into cat and give it a ^D when you're done, at which time it will compile, run, and remove the program. Obviously, you can run it without the "rm a.out" if you'd like to keep the binary. If you want to keep the source, well, you might as well just write it in vi or emacs first then.
If you're on a system that doesn't have nl, you can use cat -n.
Well its just appending your public key to the remote hosts authorized_keys, but can get messy logging in and out