如何获取find命令以文件名打印文件大小?(How do I get the find command to print out the file size with the file name?)
如果我发出find命令如下:
$ find . -name *.ear它打印出来:
./dir1/dir2/earFile1.ear ./dir1/dir2/earFile2.ear ./dir1/dir3/earFile1.ear我想要打印到命令行是名称和大小:
./dir1/dir2/earFile1.ear 5000 KB ./dir1/dir2/earFile2.ear 5400 KB ./dir1/dir3/earFile1.ear 5400 KBIf I issue the find command as follows:
$ find . -name *.earIt prints out:
./dir1/dir2/earFile1.ear ./dir1/dir2/earFile2.ear ./dir1/dir3/earFile1.earWhat I want to 'print' to the command line is the name and the size:
./dir1/dir2/earFile1.ear 5000 KB ./dir1/dir2/earFile2.ear 5400 KB ./dir1/dir3/earFile1.ear 5400 KB最满意答案
find . -name '*.ear' -exec ls -lh {} \;只是从jer.drab.org的回复的h额外。 节省时间转换成MB精神;)
find . -name '*.ear' -exec ls -lh {} \;just the h extra from jer.drab.org's reply. saves time converting to MB mentally ;)
更多推荐
发布评论