Remove ./ from result when i do find

Hi All,

When i do find command i am getting result which append ./ before the file name. For example if i am trying to search aaa.txt in current directory i am using find like this:

$ find . -name aaa.txt

result:

./aaa.txt

Now i want to remove "./" from the file name. Can some body help me to update this result?

Thanks
Vasu

find ... | sed 's#^\./##'

Hello Vasu,

I don't know any direct command but you can you use Sed command to replace "./" string.

find . -name aaa.txt|sed "s/\.\///g"

Regards,
Srikanth

Thanks Corona and Srikanth for your quick response, That works.

Or try:

find * -name aaa.txt -print
1 Like

Or, staying entirely in the shell:

[ -e aaa.txt ] && echo aaa.txt