search my harddisk - which command ???
Hello!
I want to search through my hardrive... I always thought this is done with grep, but the syyntax I used doesn't do what I want: grep -r "*.html" ./ I also tried grep -r --include="*.html" ./ didn't worked either... how do I tell grep to don't search the whole file but just the names of the files in a directory... ? EDIT: Ok, I found out that the command find should help... but also a find ./ "*.html.pdf" for example showed me all different files that just end with html or pdf...strange behaviour... maybe find ./ *.html | grep .pdf could help, but isn't there a possibility to make it with grep alone?? |
# find / -name <filename>
Regards Shmonkey |
To find a file use find:
Code:
find . -name *.html The grep command is use to pick a line with an specifc patron. For example you can search with grep using a pipe from ls (I guess you try it) Code:
ls -R path | grep .html Regards, Rafael |
thx very much, the find-command seems to work fine (not so the ls -R command...doesn't matter now...)
Is it also possible to redirect this output to the rm-command ? find . -name *.html | rm doesn't work.... |
It would be:
find . -name *.html | xargs rm -twantrd |
hi
use command locate or slocate for mre info try out man locate |
All times are GMT -5. The time now is 02:38 AM. |