~/code/icanhasfile

icanhasfile is a Python package that helps you locate and operate on files using command-line glob searches. After locating the file, you can open it in an editor, cat it, more it, less it… you know, has it.

Language: Python
License: MIT
Source: GitHub http://github.com/artloder/icanhasfile
Distribution: PyPI https://pypi.python.org/pypi/icanhasfile

Background

I spend a fair bit of time in my IDE, so I love the ability to open files via glob searches (e.g. ‘Apple+Shift+O *.xml’ provides a list of files with an ‘.xml’ extension). However, I also spend a lot of time in terminal tabs, and I miss that ability to quickly express the file I want to open and to see a list of candidate files when there are multiple matches. My typical workflow when looking for an xml file but without knowing its name:

  • find . -name ‘*.xml’
  • if multiple files, find the one I want and copy the full file path in the terminal
  • open the file

I decided to write a little command-line application for easing this use-case. I considered leveraging the find command and wrapping it in a bash script, but I really don’t enjoy bash scripting.

Comments