Append string to output in shell
问题 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. 回答1: 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/$/\