Get the Top 10 Files or Directories on Ubuntu Linux Získajte Top 10 súborov a adresárov na Ubuntu Linux
Ubuntu Linux has a rich set of commands for manipulating and accessing files. Ubuntu Linux má bohatú sadu príkazov pre manipuláciu a pristupovať k súborom. The du utility gives information on disk usage, and the sort utility can sort the results. Du utilita poskytuje informácie o využití disku a radenie nástroj môžete zoradiť výsledky. Finally, we can run those results through the head command, which gives you the top 10 lines outputted through any other command. Nakoniec môžeme spustiť tieto výsledky cez hlavu príkaz, ktorý vám dáva najvyšší 10 riadkov outputted prostredníctvom iného príkazu. We'll chain the commands together to get the output that we want. Budeme reťazca príkazy spoločne dostať výstup, ktorý chceme.
First we'll use the du -sm command to give the results in MB: Prvá budeme používať du-sm príkaz, aby výsledky v 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 — - Zdobené --
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. Teraz môžeme vidieť, že výsledky nie sú triedené, takže budeme zotrieďiť podľa sort-nr príkaz, ktorý zoradí podľa číselnej hodnoty v opačnom poradí. Finally, we'll run the results through head -10 to get the top 10 results: Nakoniec budeme riadiť výsledkami cez hlavu -10 dostať top 10 výsledkov:
This is the command we are going to run: To je príkaz budeme spúšťať:
du -sm * | sort -nr | head -10 du-sm * | sort-nr | head -10
Here's an example of the output: Tu je príklad výstupu:
$ 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. Užitočné veci.

Daily Email Updates Denný Svářeč
You can get our how-to articles in your inbox each day for free. Môžete si naše jak-na články vo vašej schránky každý deň zadarmo. Just enter your name and email below: Stačí zadať svoje meno a e-mail nižšie:



The site looks great ! Stránka vyzerá skvele! Thanks for all your help ( past, present and future !) Vďaka za vašu pomoc (v minulosti, prítomnosti a budúcnosti!)
hi nice site. hi nice site.
Nise site! Nise site!