深度阅读

How to use the 'find' command in Linux to search for files by file size?

作者
作者
2023年08月22日
更新时间
7.87 分钟
阅读时间
0
阅读量

To use the ‘find’ command in Linux to search for files by file size, you can use the following command:

find /path/to/directory -type f -size +1M

This will find all files in the specified directory and its subdirectories that are larger than 1 megabyte. You can replace /path/to/directory with the path to the directory you want to search, and replace 1M with the file size you want to search for.

You can also use the k, M, and G suffixes to specify file sizes in kilobytes, megabytes, and gigabytes, respectively. For example:

find /path/to/directory -type f -size +100k

This will find all files in the specified directory and its subdirectories that are larger than 100 kilobytes.

I hope this helps! Let me know if you have any other questions.

相关标签

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。