前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >查找当前目录下的大于1M的文件的各种实现

查找当前目录下的大于1M的文件的各种实现

作者头像
用户3765803
发布2019-03-05 09:55:31
1.1K0
发布2019-03-05 09:55:31
举报
文章被收录于专栏:悟空被FFmpeg玩悟空被FFmpeg玩

感谢小云同学,兰兰同学,以及其他同学的交流

使用find的参数实现

  1. [root@T-bagwell mnt]# find . -maxdepth 1 -size +1000000c
  2. ./sys.tar.gz
  3. ./install.tar.bz2
  4. ./CTeX_2.9.0.152_Full.exe
  5. ./php-5.3.6.tar.gz
  6. [root@T-bagwell mnt]# ls -lh
  7. total 1.3G
  8. -rw-r--r-- 1 root root 1.1G 2011-04-28 11:35 CTeX_2.9.0.152_Full.exe
  9. drwxr-xr-x 19 root root 12K 2011-04-24 20:28 git
  10. -rw-r--r-- 1 root root 135M 2011-03-18 07:00 install.tar.bz2
  11. drwxrwxrwx 8 flash games 4.0K 2011-04-24 06:38 libevent-1.4.12-stable
  12. -rw-r--r-- 1 root root 488K 2011-04-23 22:46 libevent-1.4.12-stable.tar.gz.gz
  13. drwxr-xr-x 26 root root 4.0K 2011-04-24 21:14 linux-2.6
  14. drwx------ 2 root root 16K 2011-03-10 05:56 lost+found
  15. drwxr-xr-x 10 root root 4.0K 2010-10-22 02:18 mnt
  16. drwxr-xr-x 8 1000 1000 4.0K 2011-04-24 05:51 nginx-0.8.54
  17. -rw-r--r-- 1 root root 635K 2011-04-23 21:12 nginx-0.8.54.tar.gz
  18. drwxr-xr-x 16 1005 1005 4.0K 2011-04-24 07:00 php-5.3.6
  19. -rw-r--r-- 1 root root 14M 2011-04-23 16:04 php-5.3.6.tar.gz
  20. drwxr-xr-x 8 root root 4.0K 2011-04-24 07:02 php-fpm-0.6-5.3.1
  21. -rw-r--r-- 1 root root 415K 2011-04-20 22:08 php-fpm-0.6-5.3.1.zip
  22. drwxr-xr-x 37 root root 4.0K 2011-04-24 20:40 progit
  23. drwxr-xr-x 31 root wheel 4.0K 2011-04-28 05:36 sys
  24. -rw-r--r-- 1 root root 19M 2009-07-13 22:38 sys.tar.gz
  25. [root@T-bagwell mnt]#

使用ls+awk组合管道

  1. [root@T-bagwell mnt]# find . -maxdepth 1 -size +1000000c;
  2. ./sys.tar.gz
  3. ./install.tar.bz2
  4. ./CTeX_2.9.0.152_Full.exe
  5. ./php-5.3.6.tar.gz
  6. [root@T-bagwell mnt]# ls -l .|awk '{if($5>1000000) print R$8}'
  7. CTeX_2.9.0.152_Full.exe
  8. install.tar.bz2
  9. php-5.3.6.tar.gz
  10. sys.tar.gz
  11. [root@T-bagwell mnt]#

使用find+ll+awk组合(管道)

  1. [root@T-bagwell mnt]# find ./ -name "*" -maxdepth 0 -exec ls -l {} \;|awk '{if($5>1000000) print $8}'
  2. CTeX_2.9.0.152_Full.exe
  3. install.tar.bz2
  4. php-5.3.6.tar.gz
  5. sys.tar.gz
  6. [root@T-bagwell mnt]#
  7. [root@T-bagwell mnt]# find . -maxdepth 1 -size +1000000c;
  8. ./sys.tar.gz
  9. ./install.tar.bz2
  10. ./CTeX_2.9.0.152_Full.exe
  11. ./php-5.3.6.tar.gz
  12. [root@T-bagwell mnt]#
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2011-05-05 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档