My recent article List your life in .txt proposes a structure to prioritize, contextualize and track tasks in a plain text file, todo.txt. Today I've got a few scripts that can help you manage your todo.txt from the command line, without ever opening up a text editor. These commands can mark items as complete, up their priority, and track your daily productivity rate.

Nerd Alert: The following scripts get into some nitty-gritty Unix bash scripting. One might ask, "All this for a todo list? Why not just use Tada Lists or Outlook?" Why not indeed. I explained a bit in part one why plain text is better than other, more user-friendly options, but - yes, this solution is only for the most hard core text fanatics and command-line lovers. I hope the rest of you can forgive my indulgence.

UPDATE!! These scripts have been deprecated, consolidated, and put together into one big master script. Get it here now.

Script 1: do

The first problem with todo.txt is that there's no easy way to mark a task as done. You could simply delete the line, but I'm a pack rat and want to archive my completed items so I can eventually revel in my productivity. (More on that later.) So we're going to add an "x" to the beginning of the task line to indicate it's complete. That x will send all complete items to the bottom of a sorted todo.txt listing.

The do script takes the line number of the task you completed, and prepends an "x" to it.

Here's how it works. Say you're working on your @email tasks. You get all your outstanding todo's like so. (Notice the -n switch which reveals line numbers.)

UPDATE!! These scripts have been deprecated, consolidated, and put together into one big master script. Get it here now.

Download the do script. Save as filename do (no extension). At the command line, make the script executable by using the command chmod 755 do.

Script 2: prioritize

The way we prioritize tasks inside todo.txt is to prepend a letter rating - like (A), (B), (C), etc - at the beginning of the applicable task line. That way, when you grep todo.txt items, you can sort them by priority. Say for instance, I want to check in on the finances project (denoted by p:finances):

Script 4: report

Finally, because I'm an utter data nerd, every night I want to record how many todo's I've got versus how many done's. Here's where the report script comes in. It takes no parameters, and outputs your totals by date. First it runs archive, then it appends today's date, the current number of todo's and the current number of done's to a file called report.txt. I've scheduled this script to run once a day just before midnight to help me keep track of how productive I've been over time. In fact, here's my report.txt from the last 3 days:

Final disclaimer: I'm a novice bash scripter, and many of these scripts involve my first experience using sed, a voodoo command line text editor that gets all regular expression-y on ya. I expect there will be quite a few sed ninjas out there who blanch at the sight of my terrible code. To you I apologize, invite any corrections, alternate suggestions or "what the hell were you thinking"'s in the comments or to tips at lifehacker.com.

In the meantime, have fun ./do'ing, ./prioritize'ing and ./report'ing your todo.txt!

Gina Trapani, the editor of Lifehacker, just descended into irrecoverable depths of .txt nerdery. Her semi-weekly feature, Geek to Live, appears every Wednesday and Friday on Lifehacker. Subscribe to the Geek to Live feed to get new installments in your newsreader.