List files over a specific size in current directory and all subdirectories

后端 未结 5 1824
迷失自我
迷失自我 2020-12-22 21:04

How can I display all files greater than 10k bytes in my current directory and it\'s subdirectories.

Tried ls -size +10k but that didn\'t work.

5条回答
  •  长情又很酷
    2020-12-22 21:56

    I'll add to @matchew answer (not enough karma points to comment):

    find . -size +10k -type f -maxdepth 1 -exec ls -lh {} \; > myLogFile.txt
    

    -type f :specify regular file type

    -maxdepth 1 :make sure it only find files in the current directory

提交回复
热议问题