Important! This is an automatic machine translated page. If you can read english, you should Click Here to read the original English version of the article.

Get the Top 10 Files or Directories on Ubuntu Linux Nhận được 10 tập tin đầu hoặc Thư mục trên Ubuntu Linux

Ubuntu Linux has a rich set of commands for manipulating and accessing files. Ubuntu Linux có một tập phong phú của các lệnh cho các thao tác và truy cập các tập tin. The du utility gives information on disk usage, and the sort utility can sort the results. Các tiện ích cho du thông tin về cách sử dụng đĩa, và tiện ích các loại có thể sắp xếp các kết quả. Finally, we can run those results through the head command, which gives you the top 10 lines outputted through any other command. Cuối cùng, chúng tôi có thể chạy những kết quả thông qua các lệnh đầu, trong đó cung cấp cho bạn trong 10 dòng đầu outputted qua bất kỳ lệnh khác. We'll chain the commands together to get the output that we want. Chúng tôi sẽ chuỗi các lệnh với nhau để có được sản lượng mà chúng tôi muốn.

First we'll use the du -sm command to give the results in MB: Trước tiên, chúng tôi sẽ sử dụng du-sm lệnh cho các kết quả trong MB:

$ du -sm * $ Du-sm *
1 wp-config-sample.php 1 wp-config-sample.php
1 wp-config.php 1 wp-config.php
14 wp-content 14 wp-content
1 wp-feed.php 1 wp-feed.php
—- trimmed — - Tỉa --

Now we can see that the results aren't sorted, so we'll sort them by the sort -nr command, which sorts by numerical value in reverse. Bây giờ chúng ta có thể thấy rằng các kết quả không được sắp xếp, do đó, chúng tôi sẽ sắp xếp chúng theo lệnh sắp xếp-nr, trong đó loại bằng giá trị số trong đảo ngược. Finally, we'll run the results through head -10 to get the top 10 results: Cuối cùng, chúng tôi sẽ chạy các kết quả thông qua đầu -10 để có được 10 kết quả đầu:

This is the command we are going to run: Đây là lệnh chúng tôi sẽ chạy:

du -sm * | sort -nr | head -10 du-sm * | sort-nr | head -10

Here's an example of the output: Dưới đây là một ví dụ về sản lượng của:

$ du -sm * | sort -nr | head -10 $ Du-sm * | sort-nr | head -10
14 wp-content 14 wp-content
2 wp-includes 2 wp-includes
1 xmlrpc.php 1 xmlrpc.php
1 xml.php 1 xml.php
1 x.php 1 x.php
1 wp-trackback.php 1 wp-trackback.php
1 wp-settings.php 1 wp-settings.php
1 wp-rss2.php 1 wp-rss2.php
1 wp-rss.php 1 wp-rss.php
1 wp-register.php 1 wp-register.php

Useful stuff. Công cụ hữu ích.

This article was originally written on 11/26/06 Tagged with: Bài viết này ban đầu được viết ngày 11/26/06 Tagged với: Shell Scripts Shell Script , , Ubuntu Ubuntu , , Ubuntu Tips & Tweaks Ubuntu Tips & Tweaks

Daily Email Updates Email cập nhật hàng ngày

You can get our how-to articles in your inbox each day for free. Bạn có thể làm thế nào chúng tôi vào các bài viết trong hộp thư của bạn mỗi ngày miễn phí. Just enter your name and email below: Chỉ cần nhập tên và email của bạn dưới đây:


Name: Tên:
Email: Email:

Comments (3) Comment (3)

  1. morganusvitus morganusvitus

    The site looks great ! Các trang web sẽ rất tốt! Thanks for all your help ( past, present and future !) Nhờ sự giúp đỡ của tất cả (quá khứ, hiện tại và tương lai!)

  2. alex alex

    hi nice site. hi nice site.

  3. anatol Anatol

    Nise site! Nise site!


Leave a Comment Để lại một Thảo luận




Leave your Để lại của bạn friendly thân thiện comment here. bình luận ở đây.

If you have a computer help question, Nếu bạn có một câu hỏi giúp máy tính, click here to leave it on the forums bấm vào đây để lại nó trên các diễn đàn instead. thay vì.

Note: Your comment may not show up immediately on the site. Lưu ý: Ý kiến của bạn có thể không hiển thị ngay lập tức trên trang web.

Our Friends Bạn bè của chúng tôi
Getting Started Bắt đầu


About How-To Geek Giới How-To Geek
What Is That Process? Quá trình đó là gì?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe ctfmon.exe
wmpnetwk.exe wmpnetwk.exe
mDNSResponder.exe mDNSResponder.exe
wmpnscfg.exe wmpnscfg.exe
rundll32.exe rundll32.exe
wfcrun32.exe wfcrun32.exe
Ipoint.exe Ipoint.exe
Itype.exe Itype.exe
Wfica32.exe Wfica32.exe
Mobsync.exe Mobsync.exe
conhost.exe conhost.exe
Dpupdchk.exe Dpupdchk.exe Adobe_Updater.exe Adobe_Updater.exe

Copyright © 2006-2009 HowToGeek.com. Bản quyền © 2006-2009 HowToGeek.com. All Rights Reserved. Tất cả các quyền.