编程小贴士

给你的编程提供小点子


Linux找出大文件命令技巧

Q. 如何在目录中找出所有大文件?

A.

1) 句法 for RedHat / CentOS / Fedora Linux

find {/path/to/directory/} -type f -size +{size-in-kb}k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’

实例:
查找当前目录下大于50MB的文件
$ find . -type f -size +50000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’

查找目录/var/log大于100MB的文件
# find /var/log -type f -size +100000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’

2)句法 for Debian / Ubuntu Linux
find {/path/to/directory} -type f -size +{file-size-in-kb}k -exec ls -lh {} \; | awk ‘{ print $8 “: ” $5 }’

实例:
查找当前目录下大于10MB的文件
$ find . -type f -size +10000k -exec ls -lh {} \; | awk ‘{ print $8 “: ” $5 }’

Sample output:
./.kde/share/apps/akregator/Archive/http___blogs.msdn.com_MainFeed.aspx?Type=AllBlogs.mk4: 91M
./out/out.tar.gz: 828M
./.cache/tracker/file-meta.db: 101M
./ubuntu-8.04-desktop-i386.iso: 700M
./vivek/out/mp3/Eric: 230M

列出家目录下文件大小小于500b的文件:
$ find $HOME -size -500b
OR
$ find ~ -size -500b
列出根目录下大小是20 512-byte blocks的文件:
# find / -size 20

Perl 技巧: 显示大文件
依据文件大小从小到大显示当前目录下每个目录的占用的情况(注:星号和星号的长度)

du -k | sort -n | perl -ne ‘if ( /^(\d+)\s+(.*$)/){$l=log($1+.1);$m=int($l/log(1024)); printf  (“%6.1f\t%s\t%25s  %s\n”,($1/(2**(10*$m))),((“K”,”M”,”G”,”T”,”P”)[$m]),”*”x (1.5*$l),$2);}’

ls 命令:在目录中找出最大的文件
同样你也能使用ls命令:
$ ls -lS
$ ls -lS | less
$ ls -lS | head +10
ls 命令:在目录中找出最小的文件
如下所示:
$ ls -lSr
$ ls -lSr | less
$ ls -lSr | tail -10

其它供鉴:

find . -xdev -printf ‘%s %p\n’ |sort -nr|head -20
du -xak .|sort -n|tail -50

215 Responses to “ Linux找出大文件命令技巧 ”

  1. chocopie说道:

    1WJSmr Of course, what a splendid website and instructive posts, I definitely will bookmark your website.Have an awsome day!

  2. sheets hyperlink whilst beating time. All kinds of common games plus they are of numerous genres.

  3. wow, awesome article.Really looking forward to read more. Cool.

  4. Simply wanna remark that you have a very decent web site , I love the style and design it actually stands out.

  5. line? Are you sure concerning the supply?

  6. we prefer to honor quite a few other net web-sites on the net, even though they aren

  7. Click to read说道:

    That is really fascinating, You are an excessively professional blogger.

  8. sleekness as well as classiness. An elegant ladies watch that

  9. Spot on with this write-up, I truly feel this website needs a lot more attention. I all probably be back again to read through more, thanks for the advice!

  10. web说道:

    Some truly nice stuff on this web site , I it.

  11. W88说道:

    You are mistaken. I suggest it to discuss.

  12. The methods stated in this paragraph concerning to increase traffic at you own web site are actually pleasant, thanks for such pleasant post.

  13. woking cab说道:

    posts from you later on as well. In fact, your creative writing abilities has motivated me to get

  14. cua lua tu dong说道:

    Normally I don at read article on blogs, however I would like to say that this write-up very compelled me to check out and do so! Your writing style has been amazed me. Thanks, quite great article.

  15. status说道:

    Thanks so much for the blog.Much thanks again. Great.

  16. Just wanna input that you have a very decent web site , I love the design and style it actually stands out.

  17. these camera look like it was used in star trek movies.

  18. ramsen simmonds incesticide bushell sprinkler brasserie Donelle Dalila gazzara

  19. Discover More说道:

    Thank you for another excellent post. Where else could anybody get that kind of info in such a perfect way of writing? I have a presentation next week, and I am on the look for such info.

  20. Longchamp Pas Cher Why users still use to read news papers when in this technological world all is presented on net?

  21. Thanks for spending the time to argue this, I feel starkly about it and adore conception additional taking place this topic.

  22. Thanks a lot for the blog post.Much thanks again. Keep writing.

  23. junk removala说道:

    Pretty! This has been an extremely wonderful article. Many thanks for providing this information.

  24. mp3 sounds说道:

    This content announced was alive extraordinarily informative after that valuable. People individuals are fixing a great post. Prevent go away.

  25. pre ipo说道:

    You have made some really good points there. I checked on the net for additional information about the issue and found most individuals will go along with your views on this web site.

  26. explore说道:

    Wow! This could be one particular of the most beneficial blogs We ave ever arrive across on this subject. Basically Wonderful. I am also a specialist in this topic so I can understand your hard work.

  27. My brother suggested I might like this web site. He was totally right. This post actually made my day. You cann at imagine simply how much time I had spent for this information! Thanks!

  28. Giay nam说道:

    Spot on with this write-up, I really believe that this web site needs a great deal more attention. I all probably be back again to read through more, thanks for the info!

  29. Vs model说道:

    Real wonderful info can be found on blog.

  30. seo tips说道:

    that you simply made a few days ago? Any certain?

  31. fitness说道:

    I think this is a real great blog.Thanks Again. Great.

  32. Wow, superb blog layout! How lengthy have you been blogging for? you make blogging look straightforward. The all round look of one as webpage is excellent, let alone the content material!

  33. Looking around While I was surfing yesterday I saw a great post concerning

  34. Major thanks for the blog article.Much thanks again. Fantastic.

  35. Of course, what a magnificent site and instructive posts, I will bookmark your site.Best Regards!

  36. Some truly fantastic information, Gladiolus I discovered this.

  37. Crochet poncho说道:

    You got a very wonderful website, Sword lily I detected it through yahoo.

  38. Polainas tejidas说道:

    Thank you ever so for you blog.Really thank you! Much obliged.

  39. online说道:

    Very good article post.Really thank you! Really Cool.

  40. white shoes说道:

    I think other web site proprietors should take this site as an model, very clean and magnificent user genial style and design, as well as the content. You are an expert in this topic!

  41. value说道:

    This is a topic which is close to my heart Best wishes! Where are your contact details though?

  42. we all be familiar with media is a great source of facts.

  43. School admission说道:

    wow, awesome blog.Really looking forward to read more. Really Cool.

  44. Exams说道:

    You made some good points there. I checked on the internet to learn more about the issue and found most people will go along with your views on this web site.

  45. ps4 ark servers说道:

    Major thankies for the post.Really thank you! Really Great.

  46. There is definately a lot to find out about this issue. I really like all of the points you made.

  47. types of love说道:

    Particularly helpful outlook, many thanks for writing.. So happy to possess found this post.. My personal web searches seem total.. thanks. So happy to get found this article..

  48. Thanks so much for the article.Much thanks again. Will read on

  49. Major thankies for the article.Really looking forward to read more. Will read on

  50. Wow, great post.Thanks Again. Really Cool.

  51. IaаАа’б‚Т€ТšаЂаŒаАа’б‚Т€ТžаБТžm having a little issue I cant subscribe your feed, IaаАа’б‚Т€ТšаЂаŒаАа’б‚Т€ТžаБТžm using google reader fyi.

  52. Apple Reparatur说道:

    Your style is very unique in comparison to other people I have read stuff from. I appreciate you for posting when you ave got the opportunity, Guess I all just book mark this web site.

  53. You can certainly see your skills within the work you write. The arena hopes for even more passionate writers such as you who aren at afraid to say how they believe. All the time go after your heart.

  54. This is a beautiful shot with very good lighting.

  55. I will right away take hold of your rss as I can not in finding your email subscription link or newsletter service. Do you have any? Please let me recognise so that I could subscribe. Thanks.

  56. I value the post.Much thanks again. Want more.

  57. Thanks a lot for the post.Thanks Again. Really Great.

  58. junior说道:

    I think, that you commit an error. I can defend the position. Write to me in PM, we will communicate.

  59. Judi Tembak Ikan说道:

    Say, you got a nice blog post.Really thank you! Keep writing.

  60. hotels说道:

    My partner would like the quantity typically the rs gold excellent to acquire a thing that weighs more than people anticipation.

  61. Way cool! Some very valid points! I appreciate you writing this post and also the rest of the site is also very good.

  62. Wow, amazing blog layout! How long have you been blogging for? you make blogging look easy. The overall look of your web site is excellent, as well as the content!

  63. Some really excellent information, Gladiola I observed this.

  64. Say, you got a nice blog.Much thanks again. Will read on

  65. Thanks for sharing, this is a fantastic post.Much thanks again. Great.

  66. niw说道:

    Sorry for my English.It as really a cool and helpful piece of information. I am happy that you simply shared this helpful info with us. Please keep us informed like this. Thanks for sharing.

  67. Really informative post.Really looking forward to read more. Really Great.

  68. Your style is very unique compared to other people I ave read stuff from. Many thanks for posting when you have the opportunity, Guess I will just book mark this site.

  69. Well I definitely enjoyed reading it. This article provided by you is very helpful for proper planning.

  70. Thanks so much for the article post.Really looking forward to read more. Will read on

  71. graham dailies说道:

    The Birch of the Shadow I believe there may be a couple of duplicates, but an exceedingly useful listing! I have tweeted this. Many thanks for sharing!

  72. check out说道:

    I value the article post.Thanks Again. Fantastic.

  73. There as certainly a lot to know about this topic. I really like all of the points you have made.

  74. wp commission说道:

    You made some decent points there. I checked on the net for more information about the issue and found most people will go along with your views on this site.

  75. hado green lane说道:

    I think this is a real great article. Want more.

  76. more info说道:

    Not clear on what you have in mind, Laila. Can you give us some more information?

  77. to read more说道:

    Many thanks for sharing this very good article. Very interesting ideas! (as always, btw)

  78. Respect to author, some fantastic entropy.

  79. Utterly written articles , thanks for entropy.

  80. I value the post.Thanks Again. Keep writing.

  81. Thanks again for the blog post. Fantastic.

  82. I’а†ve recently started a website, the information you provide on this site has helped me tremendously. Thanks for all of your time & work.

  83. Looking forward to reading more. Great article.Much thanks again. Awesome.

  84. What blog hosting website should I create a blog on?

  85. post说道:

    I think this internet site holds some very great info for everyone .

  86. Share now说道:

    Outstanding post, I think people should learn a lot from this web site its very user friendly. So much great info on here :D.

  87. find more here说道:

    You are my inhalation, I own few web logs and sometimes run out from post . No opera plot can be sensible, for people do not sing when they are feeling sensible. by W. H. Auden.

  88. Right now it sounds like BlogEngine is the preferred blogging platform available right now. (from what I ave read) Is that what you are using on your blog?

  89. Wow! This could be one particular of the most beneficial blogs We ave ever arrive across on this subject. Actually Excellent. I am also an expert in this topic so I can understand your effort.

  90. Very interesting subject , thankyou for putting up.

  91. Really informative blog post.Really looking forward to read more. Awesome.

  92. instances, an offset mortgage provides the borrower with the flexibility forced to benefit irregular income streams or outgoings.

  93. Red your website post and loved it. Have you at any time believed about guest posting on other related blogs similar to your site?

  94. caratulas CD说道:

    Really enjoyed this article post.Really thank you! Want more.

  95. buy说道:

    Peculiar article, just what I wanted to find.

  96. Lakisha说道:

    I simply could not depart your web site before suggesting that I actually enjoyed the usual info a person provide for your guests? Is gonna be again regularly to investigate cross-check new posts

  97. Cathey说道:

    this I have discovered It absolutely useful and it has aided me out loads.

  98. Wow! This could be one particular of the most useful blogs We ave ever arrive across on this subject. Basically Great. I am also an expert in this topic so I can understand your effort.

  99. Visit this I was recommended this website by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my trouble. You are wonderful! Thanks!

  100. Major thanks for the article. Really Great.

  101. check here说道:

    Some really select content on this site, saved to bookmarks.

  102. more info说道:

    Thank you, I ave recently been searching for info about this topic for ages and yours is the best I ave discovered till now. But, what about the bottom line? Are you sure in regards to the supply?

  103. Really enjoyed this blog article.Thanks Again. Great.

  104. link berikut说道:

    Thank you for your blog post.Thanks Again. Awesome.

  105. Foulard说道:

    Really excellent information can be found on web blog.

  106. Wow, great blog.Thanks Again. Keep writing.

  107. my portfolio说道:

    I was able to find good info from your articles.

  108. click here说道:

    Its hard to find good help I am forever saying that its hard to procure quality help, but here is

  109. good day说道:

    Thank you for your article.Thanks Again. Cool.

  110. I think you have mentioned some very interesting points, appreciate it for the post.

  111. Nice blog here! Also your site loads up fast! What host are you using? Can I get your affiliate link to your host? I wish my web site loaded up as quickly as yours lol

  112. Usually I do not read post on blogs, but I wish to say that this write-up very pressured me to try and do it! Your writing taste has been amazed me. Thanks, very nice post.

  113. Perfect piece of work you have done, this internet site is really cool with excellent information.

  114. uniform shirts说道:

    Wow, that as what I was seeking for, what a material! existing here at this website, thanks admin of this website.

  115. You are my aspiration , I have few web logs and sometimes run out from to post.

  116. Very useful information specifically the last part I care for such information much.

  117. You must participate in a contest for top-of-the-line blogs on the web. I will advocate this website!

  118. Normally I do not learn article on blogs, however I wish to say that this write-up very forced me to try and do so! Your writing style has been amazed me. Thank you, very great article.

  119. Game Online说道:

    Thank you ever so for you article post.Much thanks again. Cool.

  120. Thanks for sharing, this is a fantastic article.Much thanks again. Fantastic.

  121. meohaitac.com说道:

    This is a good tip especially to those new to the blogosphere. Brief but very precise information Appreciate your sharing this one. A must read post!

  122. It as best to participate in a contest for the most effective blogs on the web. I all recommend this site!

  123. Homemade Porn说道:

    Muchos Gracias for your blog.Really thank you! Keep writing.

  124. make men and women think. Also, thank you for permitting me to comment!

  125. right now说道:

    Informative and precise Its hard to find informative and accurate information but here I found

  126. Its hard to find good help I am constantnly saying that its difficult to get good help, but here is

  127. Thank you for your blog.Really thank you! Keep writing.

  128. Really appreciate you sharing this post.Really thank you! Great.

  129. Just wanna admit that this is handy , Thanks for taking your time to write this.

  130. Grand World说道:

    This is one awesome post.Much thanks again.

  131. Major thankies for the blog post. Really Great.

  132. It as not that I want to replicate your internet site, but I really like the design. Could you let me know which style are you using? Or was it especially designed?

  133. Really informative blog.Much thanks again. Much obliged.

  134. What as up, I read your new stuff daily. Your humoristic style is witty, keep up the good work!

  135. practice chanter说道:

    Really enjoyed this article post.Really thank you! Really Great.

  136. bitcoin说道:

    It is hard to locate knowledgeable men and women within this subject, even so you be understood as guess what takes place you are discussing! Thanks

  137. phim说道:

    Major thanks for the post.Much thanks again. Much obliged. sex animation

  138. Mobile Computer说道:

    My brother recommended I would possibly like this blog.

  139. Wow, what a video it is! Actually nice quality video, the lesson given in this video is actually informative.

  140. You need to take part in a contest for among the best blogs on the web. I will advocate this website!

  141. best pron说道:

    A47FNX Only wanna remark that you have a very nice internet site , I the design and style it actually stands out.

  142. webpage说道:

    Thank you ever so for you post.Really looking forward to read more. Will read on

  143. Really appreciate you sharing this post.Really thank you! Keep writing.

  144. Totally agree with you, about a week ago wrote about the same in my blog..!

  145. Looking around I like to look around the internet, regularly I will just go to Stumble Upon and follow thru

  146. best pron说道:

    NklRix There is noticeably a bundle to learn about this. I assume you made sure nice factors in features also.

  147. jimmyjohns2019说道:

    Perfectly written content material, Really enjoyed reading.

  148. see pron说道:

    GFOpoW Woh I like your content , saved to favorites !.

  149. You have observed very interesting points ! ps nice internet site. Tis a sharp medicine, but it will cure all that ails you. last words before his beheadding by Sir Walter Raleigh.

  150. Im thankful for the blog.Really looking forward to read more. Fantastic.

  151. mia pron khalifa说道:

    W9U5Qk I simply could not depart your site before suggesting that I really enjoyed the usual information a person provide to your visitors? Is gonna be back frequently to check out new posts

  152. Alhambra realtor说道:

    Thanks again for the article.Thanks Again. Awesome.

  153. I think this is a real great blog post.Thanks Again. Awesome.

  154. I was suggested this website by my cousin. I am not sure whether this post is written by him as nobody else know such detailed about my problem. You are incredible! Thanks!

  155. I truly appreciate this article. Much obliged.

  156. You are my inspiration, I have few web logs and very sporadically run out from post .

  157. You, my friend, ROCK! I found just the information I already searched all over the place and just could not locate it. What a perfect website.

  158. Very good article post.Really thank you! Will read on

  159. Stupid Human Tricks Korean Style Post details Mopeds

  160. What is your most noted accomplishment. They may want good listeners rather than good talkers.

  161. This very blog is really educating as well as amusing. I have picked up many helpful tips out of this source. I ad love to return again soon. Thanks a bunch!

  162. Tattoo Artist说道:

    wow, awesome blog post.Much thanks again. Keep writing.

  163. X amateurs film x amateurs gratuit Look into my page film porno gratuit

  164. This particular blog is really awesome and diverting. I have picked up helluva handy things out of this blog. I ad love to visit it over and over again. Thanks!

  165. Regards for this post, I am a big fan of this web site would like to go along updated.

  166. Tattoo Studio说道:

    Right now it appears like Drupal would be the preferred blogging platform obtainable at the moment. (from what I ave read) Is that what you are working with in your weblog?

  167. link vao 188bet说道:

    Your style is very unique in comparison to other people I ave read stuff from. I appreciate you for posting when you have the opportunity, Guess I all just bookmark this web site.

  168. Beingbar eyewear说道:

    You ave offered intriguing and legitimate points which are thought-provoking in my viewpoint.

  169. Xe Nang Dien说道:

    Please forgive my bad English.I have been reading out many of your articles and i can state nice stuff. I will make sure to bookmark your blog.

  170. It as super page, I was looking for something like this

  171. scammer说道:

    Very good blog article.Much thanks again. Fantastic.

  172. Wow, this piece of writing is fastidious, my younger sister is analyzing these things, therefore I am going to tell her.

  173. tank fit-up bed说道:

    It as difficult to find well-informed people in this particular subject, however, you seem like you know what you are talking about! Thanks

  174. I think this is a real great post.Really looking forward to read more. Awesome.

  175. Really informative article.Thanks Again. Really Great.

  176. Very good article.Really looking forward to read more. Awesome.

  177. This awesome blog is without a doubt interesting as well as informative. I have chosen helluva interesting things out of this blog. I ad love to return over and over again. Thanks!

  178. Wow! Thank you! I continuously needed to write on my blog something like that. Can I take a part of your post to my site?

  179. Indiatimes说道:

    Muchos Gracias for your post.Really thank you!

  180. Nice weblog here! Also your site quite a bit up very fast! What web host are you the usage of? Can I am getting your affiliate link to your host? I desire my web site loaded up as quickly as yours lol

  181. Thank you ever so for you post.Really thank you! Want more.

  182. purchase music说道:

    It as not that I want to copy your web site, but I really like the design and style. Could you let me know which design are you using? Or was it tailor made?

  183. viagra 50 mg说道:

    Really appreciate you sharing this article post. Really Cool.

  184. female viagra说道:

    Usually it as triggered by the sincerness communicated in the article I looked at. And on this article

  185. What as up, just wanted to mention, I loved this article. It was funny. Keep on posting!

  186. This is a really good tip particularly to those fresh to the blogosphere. Short but very accurate info Appreciate your sharing this one. A must read article!

  187. TE210说道:

    Please let me know if you are looking for a article author for

  188. Oracles gratuits en ligne voyeur voyance par tel

  189. Ruben Rojkes说道:

    You ave made some really good points there. I checked on the internet to learn more about the issue and found most individuals will go along with your views on this site.

  190. You made some good points there. I looked on the internet for the subject matter and found most persons will go along with with your site.

  191. 먹튀폴리스说道:

    writing like yours nowadays. I honestly appreciate people like you!

  192. Everett Pauley说道:

    Hi, I read your blogs daily. Your writing style is witty, keep doing what you’re doing!|

  193. This particular blog is obviously entertaining and also diverting. I have discovered a bunch of useful advices out of this amazing blog. I ad love to return again soon. Thanks a lot!

  194. Derek Torgerson说道:

    Hey there! I’ve been following your blog for a long time now and finally got the bravery to go ahead and give you a shout out from Humble Tx! Just wanted to mention keep up the fantastic job!|

  195. Right now it appears like BlogEngine is the preferred blogging platform out there right now. (from what I ave read) Is that what you are using on your blog?

  196. Tobias Pollick说道:

    I think the admin of this web page is truly working hard in support of his web site, since here every information is quality based stuff.|

  197. Im thankful for the blog article. Great.

  198. Very interesting information!Perfect just what I was looking for! The only gift is a portion of thyself. by Ralph Waldo Emerson.

  199. 다잡아说道:

    Utterly pent content material , regards for entropy.

  200. 바다 이야기说道:

    Wow! This blog looks just like my old one! It as on a completely different topic but it has pretty much the same page layout and design. Superb choice of colors!

  201. to mind. Is it simply me or does it look like li?e some of

  202. Thanks a lot for the blog post.Really looking forward to read more. Want more.

  203. It as going to be ending of mine day, however before ending I am reading this impressive post to improve my experience.

  204. There is visibly a bundle to identify about this. I feel you made some good points in features also.

  205. It as not that I want to replicate your website, but I really like the pattern. Could you tell me which theme are you using? Or was it tailor made?

  206. I value the post.Really looking forward to read more. Want more.

  207. seo tool说道:

    really excellent post, i undoubtedly actually like this incredible web-site, go on it

  208. 먹튀검증단说道:

    Very good article. I absolutely love this site. Continue the good work!

  209. 토토 사이트说道:

    You made some decent points there. I looked on the web to learn more about the issue and found most individuals will go along with your views on this web site.

  210. 다자바说道:

    together considerably far more and a lot more typical and it may very well be primarily an extension of on the internet courting

  211. That is a good tip particularly to those new to the blogosphere. Brief but very accurate info Many thanks for sharing this one. A must read post!

  212. Close-up shots, lingering close-ups of luxurious nude bodies. Hot girls shown up close and persona. Seductive close-up girls are able to seduce and provoke every man with penis. Unexpected close-up porn videos featuring unrestrained vicious intercourse.

  213. 먹튀 폴리스说道:

    The political landscape is ripe for picking In this current political climate, we feel that there as simply no hope left anymore.

  214. Ridiculous quest there. What happened after? Good luck!|

  215. Oh my goodness! Impressive article dude!

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>