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 Get Top 10 failus vai direktorijus par Ubuntu Linux

Ubuntu Linux has a rich set of commands for manipulating and accessing files. Ubuntu Linux ir bagāts komplekts komandas manipulēt un piekļūt failiem. The du utility gives information on disk usage, and the sort utility can sort the results. Du lietderība ir informācija par diska izmantošana, un šķirot lietderība var sakārtot rezultātus. Finally, we can run those results through the head command, which gives you the top 10 lines outputted through any other command. Visbeidzot, mēs varam palaist tās pa galvu komandu rezultātus, kas sniedz jums top 10 rindas outputted caur jebkuru citu komandu. We'll chain the commands together to get the output that we want. Mēs ķēde komandas kopā, lai iegūtu produkciju, ko mēs gribam.

First we'll use the du -sm command to give the results in MB: Pirmajā mēs izmantosim du-sm komandu dot ir MB rezultātus:

$ 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 — - Apgrieztām --

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. Tagad mēs varam redzēt, ka rezultāti nav sakārtoti, tāpēc mēs šķirot tos pēc sort-nr komanda, kas ar skaitlisku vērtību mainīt veidu. Finally, we'll run the results through head -10 to get the top 10 results: Visbeidzot, mēs palaist caur -10 galvu rezultātus, lai iegūtu top 10 results:

This is the command we are going to run: Šī ir komanda mēs Nobraukums:

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

Here's an example of the output: Šeit ir par produkcijas piemērs:

$ du -sm * | sort -nr | head -10 $ Du-sm * | sort-nr | galvas -10
14 wp-content 14 wp-content
2 wp-includes 2 wp-ietver
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. Noderīgas lietas.

This article was originally written on 11/26/06 Tagged with: Šis pants tika sākotnēji rakstīts uz 11/26/06 tagged with: Shell Scripts Shell Scripts , , Ubuntu Ubuntu , , Ubuntu Tips & Tweaks Ubuntu Tips & Tweaks

Daily Email Updates Daily Email Updates

You can get our how-to articles in your inbox each day for free. Jūs varat saņemt mūsu how-to rakstus savā pastkastītē katru dienu par brīvu. Just enter your name and email below: Vienkārši ievadiet jūsu vārdu un e-pasta zemāk:


Name: Vārds:
Email: E-pasts:

Comments (3) Komentāri (3)

  1. morganusvitus morganusvitus

    The site looks great ! Lapas izskatās lieliski! Thanks for all your help ( past, present and future !) Paldies visiem jūsu palīdzību (pagātni, tagadni un nākotni!)

  2. alex alex

    hi nice site. hi nice site.

  3. anatol Anatol

    Nise site! Nise site!


Our Friends Our Friends
Getting Started Getting Started


About How-To Geek Par How-To Geek
What Is That Process? Kas ir šis 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. Copyright © 2006-2009 HowToGeek.com. All Rights Reserved. All Rights Reserved.