Hacker News new | ask | show | jobs
by gofreddygo 1885 days ago
Plain text. I keep metadata embedded in the content of each file. I keep only one k:v pair per line. e.g

    "topic: D3",   
    "subject: scales",
    "context: Side Project"
Use grep and awk to slice, group, dice and join as and how I want.

Incredibly flexible, a bash-like shell is my only dependency. Works with any search engine that i've tried. Easily replacable parts. Check into git regularly.

Some scripts I use

  ## group by topic. search for lines that start with "topic". print topic and the file name
  grep -i "^topic" *.txt | awk -F ":" '{printf "%-25s%s\n",$3,$1}' | sort

  ## find all files containing the "topic" tag 
  grep -i "^topic" *.txt | awk -F ":" '{printf "%-25s%s\n",$3,$1}' | sort 


  ## find all files NOT containing "topic". useful for cleaning up 
  grep -iL "^topic" *.txt

  ## find first 10 files not containing "topic" and open each in vi sequentially
  for f in $(grep -ilL "^topic" *.txt | head); do vi $f; done
1 comments

Interesting. Thank you.

Would you have a repository of your scripts somewhere?