I usually embed the find
in a small for
loop one liner, where the find is executed in a subcommand with $()
.
Your command would look like this then:
for f in $(find *.txt); do echo "$(tail -1 $f), $(ls $f)"; done
The good thing is that instead of {}
you just use $f
and instead of the -exec …
you write all your commands between do
and ; done
.
Not sure what you actually want to do, but maybe something like this?
for f in $(find *.txt); do echo $f; tail -1 $f; ls -l $f; echo; done