How to loop through file names returned by find?

前端 未结 13 1436
野性不改
野性不改 2020-11-22 04:20
x=$(find . -name \"*.txt\")
echo $x

if I run the above piece of code in Bash shell, what I get is a string containing several file names separated

13条回答
  •  半阙折子戏
    2020-11-22 04:39

    find -xdev -type f -name *.txt -exec ls -l {} \;

    This will list the files and give details about attributes.

提交回复
热议问题