Skip to main content

Command line tool to search snippets on Commandlinefu.com

Project description

Commandlinefu.com is the place to record awesome command-line snippets. This tool allows you to search and view the results into your terminal.

Example 1

$ clf python server

  # python smtp server
  python -m smtpd -n -c DebuggingServer localhost:1025

  # Python version 3: Serve current directory tree at http://$HOSTNAME:8000/
  python -m http.server

  # Start a HTTP server which serves Python docs
  pydoc -p 8888 & gnome-open http://localhost:8888

  # put current directory in LAN quickly
  python -m SimpleHTTPServer

  # An alternative to: python -m SimpleHTTPServer for Arch Linux
  python3 -m http.server

Example 2

$ 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

  # Get Total Line Count Of All Files In Subdirectory (Recursive)
  find . -type f -name "*.*" -exec cat {} > totalLines 2> /dev/null \; && wc -l totalLines && rm totalLines

  # Recursive Line Count
  wc -l `find . -name *.php`

Installation

The tool works with Python 2 and Python 3. It can be installed with Pip :

pip install clf

Usage

Command line tool to search snippets on Commandlinefu.com

Usage:
  clf --browse [options]
  clf <command> [options]
  clf <keyword> <keyword>... [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

Notes

  • You can set the CLF_COLOR environment variable to enable to colorized output by default.

Author

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clf-0.2.tar.gz (4.8 kB view details)

Uploaded Source

File details

Details for the file clf-0.2.tar.gz.

File metadata

  • Download URL: clf-0.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for clf-0.2.tar.gz
Algorithm Hash digest
SHA256 698a3772083666438ac11c8de1002cb15c5559f0c7bb43bcaaee867fb085a10b
MD5 166a17598701599f9b47d99e1ea285e3
BLAKE2b-256 dbba84ee084be58889a7f842d30685bb80be86005d2cbd2c6386e99069b905d7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page