octopus | the octopress commander


find

The find command performs a search for a post Markdown file by filename substring.

You can use this command from any subdirectory in your main Octopress directory. The command allows you to identify one or more posts by any unique substring in the Markdown filename, including by date as this is included in every post filename.

Usage

oc find <post filename substring>

Arguments

Argument Description
post filename substring a substring in the Markdown filename

Options

None

Examples

By Day

oc find "2013-08-31"

By Month

oc find "2013-08"

By Year

oc find "2013"

By Unique Word in the Title

oc find zombie

By Unique Substring in the Title

oc find "star-wars"

Additional Information

Unique Dates

You can select one or more posts by date of Markdown file creation with a unique date string because each Markdown file is timestamped with its date of origin in the filename. Use one of the formats shown above to find one or more posts on a specific day, or during your specified combination of day, month, and year.

Unique Words

You can select one or more posts with a unique word in the post Markdown filename. The find command performs a case insensitive search for the word that you submit. Unless you manually modify them, all post Markdown filenames are in lower case characters.

Unique Substrings

You can select one or more posts with a unique substring in the post Markdown filename. Please familiarize yourself with the filename format for your post Markdown files. They include a date, followed by the post title, and lastly the .markdown file suffix.

The date strings and words in the filename are separated by dashes '-'. The dash character should be included in any multi-word (or date string) query that you submit with this command or any of the other Octopus commands that use filename substring search to locate your Markdown files. Here are a couple of examples:

oc find "multi-word-post-search"
oc find "2013-08"

Advanced Features

Command Expansion with find

You can use your shell's command expansion feature to pass the result of the oc find command to any other application. The generic command syntax looks like this:

<shell command> $(oc find <search string>)

The result of the oc find command is used as the filename (or filenames if the search string is included in multiple posts) argument for the shell command.

Here is an example of how you gzip all posts that were generated on August 18th with the gzip application:

gzip $(oc find 08-18)