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:
Original author unknown (I believe off of a wifi hacking forum).
Used in conjuction with ifconfig and cron.. can be handy (especially spoofing AP's)
In July 2008, there was an uproar over Foxconn motherboards feeding Linux installs incorrect ACPI information (http://ubuntu-virginia.ubuntuforums.org/showthread.php?t=869249).
Foxconn has gladly corrected their mistake, but make sure it's not happening on your motherboard!
After running the command, just view the 'dsdt.dsl' in any editor you like.
tells you the number of lines in said file, and then tail the last 100 lines ( or how many are messed up) then u take the total amount of lines and then subract the 100 or so lines u DONT WANT, then do a head -n $new_number and then redirect it to new file.db
Show message in file "welcome" to all logged in terminal users.
Great for little scripts that dig up obscure info that you are going to have to paste into another app anyway.
with this command you can empty file
Just run the command, type your password, and that's the last time you need to enter your password for that server.
This assumes that the server supports publickey authentication. Also, the permissions on your home dir are 755, and the permissions on your .ssh dir are 700 (local and remote).
This removes the type prefix used in Hungarian notation (v. bad) for PHP variables. Eg. variables of the form $intDays, $fltPrice, $arrItems, $objLogger convert to $days, $price, $Items, $logger.
`split -b 1k file` splits files into 1k chunks. Rejoin them with `cat x* > file`.
Good to find out about hostile processes
This command is useful for separating a text file where all the words are in one line. Any group of spaces will be replaced with a single newline. Instead of one long line of tokens. You'll have a long list of tokens. One token per line.
This is priceless for discovering otherwise invisible characters in files. Like, for example, that stray Control-M at the end of the initial hash bang line in your script, which causes it to generate a mysterious error even though it looks fine.
('od' is the last word, of course, but for many purposes it's much harder to read.)
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.
Useful for checking if there are differences between local and remote files.