Commands by boustrophedon757 (2)

  • World Cup Live Score of the ongoing match. Alternative to have the live score with the match statistics: watch -n10 --no-title "w3m http://www.livescore.com/ |awk '/live [0-9H]+[^ ]/,/red cards/'" Show Sample Output


    1
    watch -n10 --no-title "w3m http://www.livescore.com/ |egrep 'live [0-9H]+[^ ]'"
    boustrophedon757 · 2014-06-12 21:44:26 6
  • Just feed classical duckduckgo request replacing the "!" for the bang by a "-" (ie. "ddg -gi mickey mouse") and the result will be opened in w3m (think of installing w3m-img for image support in xterm or tty) To put it in the .bashrc, remove the "\" that escapes the "!".


    0
    ddg(){ search=""; bang=""; for term in $@; do if [[ "$term" =~ -([A-Za-z0-9._%+-]*) ]]; then bang="\!${BASH_REMATCH[1]}" ; else search="$search%20$term" ; fi ; done ; w3m "https://www.duckduckgo.com/?q=$bang$search" ;}
    boustrophedon757 · 2013-10-30 21:41:36 6

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

check open ports without netstat or lsof

how to allow a program to listen through the firewall
To allow a program ("programmaautorizzato" in example) to listen through the firewall

Find the biggest files
Also: * find . -type f -exec ls -s {} \; | sort -n -r | head -5 * find . -type f -exec ls -l {} \; | awk '{print $5 "\t" $9}' | sort -n -r | head -5

Nicely display permissions in octal format with filename
Since the original command (#1873) didn't work on FreeBSD whose stat lacks the "-c" switch, I wrote an alternative that does. This command shows also the fourth digit of octal format permissions which yields the sticky bit information.

Analyze awk fields
Breaks down and numbers each line and it's fields. This is really useful when you are going to parse something with awk but aren't sure exactly where to start.

Get movie length

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"

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"

Add Password Protection to a file your editing in vim.
While I love gpg and truecrypt there's some times when you just want to edit a file and not worry about keys or having to deal needing extra software on hand. Thus, you can use vim's encrypted file format. For more info on vim's encrypted files visit: http://www.vim.org/htmldoc/editing.html#encryption

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"


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: