Hacker News new | ask | show | jobs
by QE2 6126 days ago
so hard to find, for example, a file with "accounts" in its name and "automobiles" in the contents ... Consider the UNIX find command which searches based on file metadata and the grep command which searches file contents. Combining the two is not easy.

		grep -i automobiles `find / -type f -name *accounts*`
Interestingly, Amazon are currently being sued because they threw away someone’s metadata in the process of removing a copy of Orwell’s 1984 from a Kindle. You can bet the metadata was removed automatically when the content was removed.

Actually, they are restoring the file to anyone who wants it, including all notes.

http://www.engadget.com/2009/09/04/amazon-offers-to-give-bac...

2 comments

This is at the application level. The point is that there's no way to do this as one search without building an index a la Spotlight. You can't write a program called "nameandcontents" that does the above without doing exactly what find and grep do - there is always the data equivalent of NUMA... call it Non-Uniform Data Access. The author wants, at an architectural level, but not application level, UDA.
You could also use:

    find / -name *accounts* | xargs grep -i automobiles