如果我发出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 KB
find . -name '*.ear' -exec ls -lh {} \;
只是从jer.drab.org的回复的h额外。节省时间转换为MB精神;)