to be more specific ,I want to display contents of files from output of find command,I tried the following commands but they don't get my work done
cat < find . -name "*.txt"find . -name "*.txt" | cat
Either
find . -name "*.txt" | xargs cat --
or (better, if you have GNU find)
find . -name "*.txt" -print0 | xargs -0 cat --
or
find . -name "*.txt" -exec cat -- {} +
You can use below the below command to display contents of files
Method 1:
find . -type f -iname "*.txt" -exec cat {} \;
Method 2:
ls -ltr *.txt | awk '{print "cat" " " $9}' | sh