duc
duc copied to clipboard
Feature request : search file in index
Hi,
Since the index already exist, instead of using locate or find, can you add a search command to find file or directory quickly from the index ?
The use case is
- I identify a big file in the gui
- I want to delete it however I don't know the path
rm -i $(duc search mybigfile.data)
Thanks
"Cyril" == Cyril SANTUNE @.***> writes:
Cyril> Since the index already exist, instead of using locate or find, Cyril> can you add a search command to find file or directory quickly Cyril> from the index ?
Cyril> The use case is
Cyril> * I identify a big file in the gui Cyril> * I want to delete it however I don't know the path Cyril> * rm -i $(duc search mybigfile.data)
This is an interesting idea. But I'm not sure I'd pipe it right to rm, since it's too easy to delete the wrong thing.
How would you want the filename or directory name to be specified when searching? Regular expressions? Standard Unix file globbing? It might be simpler to leverage the existing 'find' command syntax instead.
Thanks for the suggestion, if you have any comments on how it would be used, that would help.
I won't have time in the near future to implement anything, so feel free to look over the source and add a 'find.c' and 'find.h' setup to add into the existing command structure.
John
@crile alternative solution, build duc with sqlite3 storage and then you can use sqlite3 command line tool to query.