Where did I put that nifty function I wrote?

I know everyone probably knows this, but I’m noting this here, more for my benefit than other people’s.

Consider the following (addled Alzheimers programmers are familiar I’m sure…) About to write a new script but sure that you’ve done something similar.

In my case, with the GPS and text message stuff I do, I’m always doing date conversions.

Grep is your friend – in a terminal, type

$ grep -rl "datetime" /home/daniel/Documents/dansdocs/python/danPython

And hey presto, there’s a list of the files that mention “datetime” or any other string you care to try.

This entry was posted in Code, Diary, Linux and tagged . Bookmark the permalink.