ilugd
Beware of the innocent
I have been using the following command to search for files on my hard disk
ls -R | grep pattern
to find files named pattern or something.
But the problem is that i am unable to find the whole path. So then I have to search again trying in increments of 5 lines or so before that. Like
ls -R |grep -B 5 pattern
and if the path is not listed then
ls -R |grep -B 10 pattern
and so on. finally I get the path.
There has got to be a simpler way right?
I tried searching but am not able to make much sense out of them. Can someone please help?
ls -R | grep pattern
to find files named pattern or something.
But the problem is that i am unable to find the whole path. So then I have to search again trying in increments of 5 lines or so before that. Like
ls -R |grep -B 5 pattern
and if the path is not listed then
ls -R |grep -B 10 pattern
and so on. finally I get the path.
There has got to be a simpler way right?
I tried searching but am not able to make much sense out of them. Can someone please help?