Commands by kovirobi (1)

  • This removes the enclosing quotation marks ("), and sticthes the different packets together, e.g. ' Show Sample Output


    0
    wki () { dig +short txt "${*// /_}".wp.dg.cx | sed -e 's/^"\(.*\)"$/\1/' -e 's/\([^\]\)"[^\]*"/\1/g' -e 's/\\\(.\)/\1/g' }
    kovirobi · 2012-05-30 11:36:25 0

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

online MAC address lookup

Find top 10 largest files in /var directory (subdirectories and hidden files included )
Same as above, but modified to show human readable output

%s across multiple files with Vim
src: http://www.ibrahim-ahmed.com/2008/01/find-and-replace-in-multiple-files-in.html

Check reverse DNS
I'm just a simple programmer. I find dig too verbose. host tells me alias(es) and IP address in a quick to grok format with nothing special to remember for input parameters. With thanks to http://www.cyberciti.biz/faq/how-to-test-or-check-reverse-dns/

Insert the last argument of the previous command
for example if you did a: $ ls -la /bin/ls then $ ls !$ is equivalent to doing a $ ls /bin/ls

Start a game on the discrete GPU (hybrid graphics)
On laptops featuring hybrid graphics and using the free X drivers, the DRI_PRIME variable indicates which GPU to run on. This alias allows to utilize the faster discrete GPU without installing proprietary drivers.

unbuffered tcpdump
Sometimes the question comes up: How to get unbuffered tcpdump output into the next program in the pipe? i.e. if your OS forces you to wait for the buffer to fill before the next program sees any of the output If you use -Uw- then you can't use -A (or -X or -XX) at the same time. When the question comes up, I've never seen anyone suggest this simple solution: chaining 2 tcpdump instances.

find sparse files
Prints the path/filename and sparseness of any sparse files (files that use less actual space than their total size because the filesystem treats large blocks of 00 bytes efficiently).

Get debian package names corresponding to latex packages used in a document

Create a mirror of a local folder, on a remote server
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22) (all files & folders on destination server/folder will be deleted)


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: