Pattern to include the path in fd/ fdfind result

Viewed 16

With $loc=/path/to/location, the following command

fdfind . $loc --type d

will list all sub-directories of $loc/

However I want to also include $loc in the list. What other pattern can I use to achieve this.

I tried

fdfind .* $loc --type d

but it just lists everything!

For now, I can do something hacky like this:

fdfind . $loc --type d > temp.txt
echo $loc | cat - temp.txt

What is a better solution?

p.s.: fd is called fdfind in Ubuntu.

0 Answers
Related