在Linux下,你可以使用find
命令来查找大文件。以下是一些常用的方法:
find . -type f -size +100M
这里,.
表示当前目录,-type f
表示查找文件类型为普通文件,-size +100M
表示查找大于100MB的文件。
/home/username
)及其子目录中,大于500MB的文件:find /home/username -type f -size +500M
find . -type f -size +100M -exec ls -lh {} \; | sort -rh -k5
这里,-exec ls -lh {} \;
表示对查找到的文件执行ls -lh
命令,以便查看文件的详细信息。sort -rh -k5
表示按照第5列(即文件大小)降序排列结果。
find . -type f -size +1G -iname "*.mp4"
这里,-iname "*.mp4"
表示查找扩展名为.mp4
的文件,不区分大小写。
你可以根据需要修改查找条件,例如改变文件大小阈值或指定其他目录。