I often forget to sudo before editing a file I don't have write permissions on. When you come to save that file and get the infamous "E212: Can't open file for writing", just issue that vim command in order to save the file without the need to save it to a temp file and then copy it back again.
works like a charm for the K610i
kills all pids matching the search term of "PROCESS". Be careful what you wish for :)
mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool. As mtr starts, it investigates the network connection between the host mtr runs on and HOSTNAME. by sending packets with purposly low TTLs. It continues to send packets with low TTL, noting the response time of the intervening routers. This allows mtr to print the response percentage and response times of the internet route to HOSTNAME. A sudden increase in packetloss or response time is often an indication of a bad (or simply over‐loaded) link. Show Sample Output
Check the status of a 'dd' in progress. useful when creating very large dumps and want to see how far along it is. Sending the kill -USR1 forces dd to dump it's progress to stdout
This will launch a listener on the machine that will wait for a connection on port 1234. When you connect from a remote machine with something like : nc 192.168.0.1 1234 You will have console access to the machine through bash. Show Sample Output
Now try to recover without rebooting, for an extra 10 points.
This command is a fork bomb! Proceed with caution. ;)
creates a large number of processes very quickly in order to overload an OS to stop this bomb in about 45 sec. Type: while (sleep 100 &!) do; done or do a killall
A common typo from the PFY (the key's are like right next to each others).
show phpinfo(); from the command line Show Sample Output
5 out of 6 times its really funny. Show Sample Output
This will completely erase everything on your hard drive and is not reversible.
The PID will only be printed if you're holding a root equivalent ID.
Very useful for rerunning a long command changing some arguments globally. As opposed to ^foo^bar, which only replaces the first occurrence of foo, this one changes every occurrence.
It's reboot the machine when the machin is started :) is funny for use with n00bs
It's a funny command what execute all the file ~/.bash_history
Similarly, if you want to print from 10 to the end of line you can use: sed -n '10,$p' filename This is especially useful if you are dealing with a large file. Sometimes you just want to extract a sample without opening the entire file. Credit goes to wbx & robert at the comments section of http://www.commandlinefu.com/commands/view/348/get-line1000-from-text.#comment
To generate the keys use the command ssh-keygen
Alternatively, run as root and take out the sudo.
!whatever will search your command history and execute the first command that matches 'whatever'. If you don't feel safe doing this put :p on the end to print without executing. Recommended when running as superuser.
commandlinefu.com is the place to record those command-line gems that you return to again and again. 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.
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.
» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10
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: