Commands by arighi (1)

What's this?

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.

Share Your Commands


Check These Out

Backup with versioning
Apart from an exact copy of your recent contents, also keep all earlier versions of files and folders that were modified or deleted. Inspired by the excellent EVACopy http://evacopy.sourceforge.net

Install pip with Proxy
Installs pip packages defining a proxy

grep tab chars
mixing tabs and spaces for indentation in python would confuse the python interpreter, to avoid that, check if the file has any tab based indentation. "^V" => denotes press control + v and press tab within quotes. $ cat improper_indent.py class Tux(object): print "Hello world.." $ grep " " improper_indent.py print "Hello world.."

find the longest command in your history

Pick a random line from a file
This is from perldoc -q random.*line, which says: This has a significant advantage in space over reading the whole file in. You can find a proof of this method in The Art of Computer Programming, Volume 2, Section 3.4.2, by Donald E. Knuth. Who am I to argue with Don Knuth?

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

A command to copy mysql tables from a remote host to current host via ssh.
This version compresses the data for transport.

disassemble binary shellcode
The options -b binary and -m are needed for disassembling raw machine code when it is not part of a full binary executable with proper headers.

VMware Server print out the state of all registered Virtual Machines.
I use this command on my machines running VMware Server to print out the state of all registered Virtual machines.

Play musical notes from octave of middle C
Are there any creative pieces of music that can be created using beep and the shell? I'd love to hear it!


Stay in the loop…

Follow the Tweets.

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

Subscribe to the feeds.

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: