I am trying to list all the file names (the basename, not the full path) below my home directory using find. I tried to do:
find ~/ -type f -exec echo $(basename "{}") ";"
However I end up having a list of full paths, and not only of the basenames as I would like. I now use echo
, but ideally the result of $(basename "{}")
should be the argument of some other function I want to write.
Why is the basename function not applied correctly?