Reputation: 37
I want to append "/*" to the output paths from the below cmd:
find /home/mba/Desktop/ -type d -name "logs"
I tried to use sed regex as below:
find /home/mba/Desktop/ -type d -name "logs" | sed -e 's/(^.)/\1//'
But I got the below error: sed: -e expression #1, char 14: unknown option to `s'
Thanks in advance.
Upvotes: 2
Views: 199
Reputation: 20355
This is a working solution using awk
:
find /home/mba/Desktop/ -type d -name "logs" | awk '{ print $1"/*" }'
Or with sed
:
find /home/mba/Desktop/ -type d -name "logs" | sed 's/$/\/\*/'
Upvotes: 1