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. דברים שימושיים.

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



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