Locate search is not limitable to current directory:
I am trying to learn so I decided to write this script
cd /usr/share/doc && ls -R | grep "\.html" | sudo tee htmldoclist.txt
Then I want to pipe the doc list into locate command similar to
locate $(head -n 1 htmldoclist.txt)
but I want to use cat
.
I want to save the output of this to hlinks.txt
and use sed
to append file://
to line starts with pipe to sed
as follows:
| sed -e 's/^/file:///g'
I expect to create a bunch of terminal hyperlinks for my documentation files stored in /usr/share/docs