5

Execute on the basename of a find command

view full story
linux-howto

http://unix.stackexchange.com – Suppose I have a directory structure as follows test test/a test/b Now I want to execute a command, such that in the . folder I can execute a command on the basename of the files a and b. So basically, I want something like this, which I naively tried find test -type f -exec touch `basename {}` \; Only, this does not result in empty files a and b in the parent directory. Suppose that my touch command can only take a single argument. I know how to do this in a bash script, but I am interested in single command solution. (HowTos)