4 ms·
find ~/Documents -exec ls -l {} \; > ~/Documents/filelist.txt && grep "somefileiwant" ~/Documents/filelist.txt Its all I've ever needed.
by fit2rule 11y ago
find ~/Documents -exec ls -l {} \; > ~/Documents/filelist.txt && grep "somefileiwant" ~/Documents/filelist.txt
Its all I've ever needed.
- nurb 11y agols -lh $(find ~/Documents | grep "somefileiwant") It's all you should ever need.
- qwertyboy 11y agoYou guys do realize that most `find` implementations support both the `-ls` and the `-name` flags, right? find ~/Documents -name somefile -ls
- brbsix 11y agoI don't really understand this. Why use grep? You can just use `find ~/Documents -name somefileiwant -ls`. You can use -regex or -path if you need to use regular expressions to describe a filename or path, respectively. Alternatively, if you really wanted to use find and grep together, there is no need for any file I/O. You can just use `find ~/Documents -exec ls -l {} + | grep somefileiwant`.
- fit2rule 11y agoI use grep so I can just come back later and do more grep'ing if needed or even do more complicated grips. ;) Just have to remember to update the filelist.txt file every week or so .. anyway its ghetto and I like it.
- aw3c2 11y agoYou might like mlocate.
- fouric 11y agoThat's OK, this tool isn't for everyone :) Lightning was built because I was tired of both the "cd x; ls; cd x; ls; cd x" and "cd x<tab>x<tab>/xx<tab>x<tab>" patterns and wanted something faster where all I had to do was hit the right keys and I would automagically get to my destination. It's less about finding files than it is about getting to them; in fact, I can imagine myself opening files found with the above method much faster with Lightning than I would using standard shell tools. But that might just be me.