Shell finds three ways to find files larger than 1M in the current directory share the _linux shell

Source: Internet
Author: User
Tags bz2 fpm

1, using Find parameters to achieve

Copy Code code as follows:

[Root@xiaobb mnt]# Find. -maxdepth 1-size +1000000c
./sys.tar.gz
./install.tar.bz2
./ctex_2.9.0.152_full.exe
./php-5.3.6.tar.gz
[Root@xiaobb mnt]# LS-LH
Total 1.3G
-rw-r--r--1 root root 1.1G 2011-04-28 11:35 ctex_2.9.0.152_full.exe
Drwxr-xr-x root root 12K 2011-04-24 20:28 git
-rw-r--r--1 root root 135M 2011-03-18 07:00 install.tar.bz2
DRWXRWXRWX 8 Flash Games 4.0K 2011-04-24 06:38 libevent-1.4.12-stable
-rw-r--r--1 root root 488K 2011-04-23 22:46 libevent-1.4.12-stable.tar.gz.gz
Drwxr-xr-x root root 4.0K 2011-04-24 21:14 linux-2.6
DRWX------2 root 16K 2011-03-10 05:56 lost+found
Drwxr-xr-x root root 4.0K 2010-10-22 02:18 mnt
Drwxr-xr-x 8 1000 1000 4.0K 2011-04-24 05:51 nginx-0.8.54
-rw-r--r--1 root root 635K 2011-04-23 21:12 nginx-0.8.54.tar.gz
Drwxr-xr-x 1005 1005 4.0K 2011-04-24 07:00 php-5.3.6
-rw-r--r--1 root root 14M 2011-04-23 16:04 php-5.3.6.tar.gz
Drwxr-xr-x 8 root root 4.0K 2011-04-24 07:02 php-fpm-0.6-5.3.1
-rw-r--r--1 root root 415K 2011-04-20 22:08 php-fpm-0.6-5.3.1.zip
Drwxr-xr-x Notoginseng root root 4.0K 2011-04-24 20:40 progit
Drwxr-xr-x root wheel 4.0K 2011-04-28 05:36 sys
-rw-r--r--1 root root 19M 2009-07-13 22:38 sys.tar.gz
[Root@xiaobb mnt]#

2. Use Ls+awk combination pipe

Copy Code code as follows:

[Root@xiaobb mnt]# Find. -maxdepth 1-size +1000000c;
./sys.tar.gz
./install.tar.bz2
./ctex_2.9.0.152_full.exe
./php-5.3.6.tar.gz
[Root@xiaobb mnt]# ls-l. | awk ' {if ($5>1000000) print r$8} '
Ctex_2.9.0.152_full.exe
install.tar.bz2
Php-5.3.6.tar.gz
Sys.tar.gz
[Root@xiaobb mnt]#

3. Use Find+ll+awk combination (pipe)

Copy Code code as follows:

[Root@xiaobb mnt]# find./-name "*"-maxdepth 0-exec ls-l {} \;|awk ' {if ($5>1000000) print $} '
Ctex_2.9.0.152_full.exe
install.tar.bz2
Php-5.3.6.tar.gz
Sys.tar.gz
[Root@xiaobb mnt]#
[Root@xiaobb mnt]# Find. -maxdepth 1-size +1000000c;
./sys.tar.gz
./install.tar.bz2
./ctex_2.9.0.152_full.exe
./php-5.3.6.tar.gz

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.