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 Gauti Top 10 failų ar katalogų Ubuntu Linux

Ubuntu Linux has a rich set of commands for manipulating and accessing files. Ubuntu Linux turi turtingą rinkinį komandas manipuliuoti ir gauti failus. The du utility gives information on disk usage, and the sort utility can sort the results. Du naudingumo pateikiama informacija apie disko vietos, ir rūšiuoti komunalines galima rūšiuoti rezultatus. Finally, we can run those results through the head command, which gives you the top 10 lines outputted through any other command. Galiausiai, mes galime paleisti tas per galvą komandų rezultatus, kurie suteikia jums top 10 eilučių outputted per bet kurią kitą komandą. We'll chain the commands together to get the output that we want. Mes grandinės komandos kartu gauti produkcijos, kad mes norime.

First we'll use the du -sm command to give the results in MB: Pirmiausia mes naudosime du-SM komandą suteikti MB rezultatai:

$ 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 — - Kraštais --

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. Dabar mes matome, kad rezultatai nėra rūšiuojamos, todėl mes rūšiuoti jas rūšiuoti-nr komandą, kuri rūšiuoja pagal skaitinę vertę atvirkščiai. Finally, we'll run the results through head -10 to get the top 10 results: Galiausiai, mes atliksime per galvą -10 rezultatai gauti 10 geriausių rezultatų:

This is the command we are going to run: Tai komandą mes ruošiamės Rida:

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

Here's an example of the output: Štai produkcijos pavyzdys:

$ 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. Useful stuff.

This article was originally written on 11/26/06 Tagged with: Šis straipsnis buvo parašytas ant 11/26/06 Tagged with: Shell Scripts Shell scripts , , Ubuntu Ubuntu , , Ubuntu Tips & Tweaks Ubuntu Tips & tweaks

Daily Email Updates Dienos paštas Atnaujinimai

You can get our how-to articles in your inbox each day for free. Galite gauti mūsų kaip prie straipsnių į Jūsų pašto dėžutę kasdien nemokamai. Just enter your name and email below: Tiesiog įveskite vardą ir elektroninio pašto adresą žemiau:


Name: Pavadinimas:
Email: Paštas:

Comments (3) Komentarai (3)

  1. morganusvitus morganusvitus

    The site looks great ! Site looks great! Thanks for all your help ( past, present and future !) Dėkojame už jūsų pagalbą (praeitis, dabartis ir ateitis!)

  2. alex Alex

    hi nice site. hi nice site.

  3. anatol Anatol

    Nise site! Nise site!


Our Friends Mūsų draugai
Getting Started Paruo


About How-To Geek Apie How-To Geek
What Is That Process? Kas yra šis procesas?
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.