clf: Commandlinefu snippet search

terminalWhat if you wanted to share your audio over the LAN using simple shell scripts? It’s not very easy to do it b yourself without spending some amount of time. However, people have done it and shared their scripts on the internet. Commandlinefu is a huge┬árepository of such innovative scripts. What if you could search access those scripts when you needed one?

Of course, you can fire your browser and search. But if you are terminal-savvy, you may not consider the solution very elegant. clf is a python tool that enables you to search Commandlinefu and view the snippets matching your description. Take your pick! Nifty, eh? You can even use it over a remote terminal without opening the browser.

It also allows you to browse the Commandlinefu archive.

Installation

To install clf, run:

$ sudo pip install clf

Usage

The basic syntax of the command is:

$ clf description
e.g.
$ clf recursive line count

# Recursive Line Count
find ./ -not -type d | xargs wc -l | cut -c 1-8 | awk '{total += $1} END {print total}'

# Recursive Line Count
find * -type f -not -name ".*" | xargs wc -l

Option details and examples:

Command line tool to search snippets on Commandlinefu.com

Usage:
  clf --browse [options]
  clf  [options]
  clf  ... [options]

Options:
  -h, --help     Show this help.
  -v, --version  Show version.
  -c, --color    Enable colorized output
  -b, --browse   Browse the Commandlinefu.com archive.
  --order=ORDER  The order output (votes|date) [default: votes]

Examples:
  clf tar
  clf python server
  clf --browse --order=date

On GitHub: clf

Leave a Reply

Your email address will not be published. Required fields are marked *