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 קבל את המדורגים 10 קבצים או ספריות על אובונטו לינוקס

Ubuntu Linux has a rich set of commands for manipulating and accessing files. אובונטו לינוקס יש אוסף עשיר של פקודות עבור המניפולציה והגישה קבצים. The du utility gives information on disk usage, and the sort utility can sort the results. השירות du נותן מידע על שימוש בדיסק, ואת השירות מין ניתן למיין את התוצאות. Finally, we can run those results through the head command, which gives you the top 10 lines outputted through any other command. לבסוף, אנחנו יכולים להריץ את התוצאות באמצעות הפקודה הראש, אשר נותן לך את 10 קווי outputted באמצעות פקודה אחרת. We'll chain the commands together to get the output that we want. אנחנו בשרשרת פקודות ביחד כדי לקבל את הפלט שאנחנו רוצים.

First we'll use the du -sm command to give the results in MB: ראשית נשתמש הפקודה du-Sm לתת את התוצאות 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 — - גזוז --

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. עכשיו אנחנו יכולים לראות כי התוצאות אינן מיון, כך אנחנו למיין אותם לפי למיין את Nr-הפקודה, אשר מיני על ידי הערך המספרי במהופך. Finally, we'll run the results through head -10 to get the top 10 results: לבסוף, אנו נפעיל את התוצאות דרך הראש -10 כדי לקבל את 10 התוצאות:

This is the command we are going to run: זוהי פקודה אנחנו הולכים לרוץ:

du -sm * | sort -nr | head -10 du-SM * | מעין-nr | ראש -10

Here's an example of the output: הנה דוגמה של הפלט:

$ du -sm * | sort -nr | head -10 $ Du-SM * | מעין-nr | ראש -10
14 wp-content 14 wp-content
2 wp-includes 2 wp-כוללת
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. דברים שימושיים.

This article was originally written on 11/26/06 Tagged with: מאמר זה נכתב במקור ב 11/26/06 עם שתייגת: Shell Scripts סקריפטים Shell , , Ubuntu Ubuntu , , Ubuntu Tips & Tweaks Ubuntu Tips & Tweaks

Daily Email Updates שערי עדכונים בדוא"ל

You can get our how-to articles in your inbox each day for free. אתה יכול לקבל כמה שלנו למאמרים לתיבת הדואר שלך בכל יום בחינם. Just enter your name and email below: פשוט להזין את שם ואת הדוא"ל שלך להלן:


Name: שם:
Email: דואר אלקטרוני:

Comments (3) תגובות (3)

  1. morganusvitus morganusvitus

    The site looks great ! האתר נראה נהדר! Thanks for all your help ( past, present and future !) תודה על כל העזרה שלך (בעבר, בהווה ובעתיד!)

  2. alex אלכס

    hi nice site. היי האתר נחמד.

  3. anatol אנטול

    Nise site! האתר Nise!


Leave a Comment השאירו תגובה




Leave your השאירו שלך friendly ידידותי comment here. תגובה כאן.

If you have a computer help question, אם יש לך מחשב לעזור השאלה, click here to leave it on the forums לחץ כאן כדי להשאיר אותו על פורומים instead. במקום.

Note: Your comment may not show up immediately on the site. הערה: ההערה שלך לא תופיע מיד באתר.

Our Friends חברים שלנו
Getting Started התחלת העבודה


About How-To Geek אודות How-To Geek
What Is That Process? מה זה תהליך?
svchost.exe svchost.exe
jusched.exe jusched.exe
dwm.exe dwm.exe
ctfmon.exe Ctfmon.exe
wmpnetwk.exe wmpnetwk.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. זכויות יוצרים © 2006-2009 HowToGeek.com. All Rights Reserved. כל הזכויות שמורות.