How to determine your free disk space in Linux Kā noteikt savu brīvo diska vietu Linux

by Sukrit Dhandhania on December 30, 2008 ar Sukrit Dhandhania 2008 December 30,

Linux

Although hard drive space is cheap today and we happily throw in a few hundred gigabytes into a server or a desktop, it's amazing how often the disk gets full. Kaut arī cietā diska vieta ir lēts šodien, un mēs laimīgi iemest dažus simtus gigabaitu serverī, vai desktop, tas ir pārsteidzošs, cik bieži disks kļūst pilns. Here are a few Linux tools to help you see how much of your disk has been eaten up, and what's eating it up, so that you can do something about it before it gets out of hand. Šeit ir daži Linux rīkus, kas palīdz jums redzēt, cik daudz disks ir ēst uz augšu, un to, kas ēd to uz augšu, lai jūs varētu kaut ko darīt, pirms tā kļūst nekontrolējama.

The first command we'll look at is the “df” command. Pirmo komandu mēs apskatīt ir "DF" komandu. It comes bundled with all distributions of Linux. Tā nāk komplektā ar visiem Linux sadalēm. “df” stands for “disk free”. "DF" nozīmē "disku bez maksas". It gives you a reading of the state of all your partitions. Tas dod jums lasot stāvokļa visu jūsu starpsienām. It gives you the total disk space, the used space, the space available, and then the percentage of space being used. Tas dod jums kopā diska vietu, ko izmanto telpu, telpa ir pieejami, un pēc tam procentuāli telpas tiek izmantotas.

# df -h # Df-h
Filesystem Size Used Avail Use% Mounted on Filesystem Size Used Pieej Lietojiet% Mounted par
/dev/sda5 57G 2.4G 52G 5% / / dev/sda5 57G 2.4G 52g 5% /
/dev/sda1 99M 12M 83M 12% /boot / dev/sda1 99m 12M 83m 12% / boot
/dev/sda2 15G 1.3G 13G 10% /home / dev/sda2 15G 1.3 13G 10% / home

The is the kind of reading you can get from df. Tiek veida lasīšanas jūs varat saņemt no DF. In the above example I have used the option “-h” which gives the output in a human-readable format. Jo iepriekš minētajā piemērā man ir izmantojuši iespēju "-h", kas sniedz produkcijas cilvēkiem lasāmā formātā. So, instead of showing me the disk space in bytes it uses megabytes and gigabytes which is easier for us to interpret. Tā vietā, kurā man diskā baitos, ko tā izmanto megabaiti un gigabaiti, kas ir vieglāk mums interpretēt.

Another command I find a lot of use for is “du”. Vēl viena komanda varu atrast daudz izmantošana ir "du". “du” stands for “disk usage”. "Du" nozīmē "diska izmantošana". It can give you a reading of the amount of space a file or folder is using up. Tas var sniegt jums nolasīt vietas daudzumu, faila vai mapes izmanto augšu. To check the amount of space being consumed by a directory called 'data' use the following command: Lai pārbaudītu vietas daudzumu, ko patērē direktoriju sauc par "datu" izmantošana šādu komandu:

# du -sh data # Du-sh dati
104K data/ 104k data /

For the above command I have used the following options – “-s” which stands for “summarize”, and “h”, which makes the output human-readable. Attiecībā uz iepriekš minēto komandu esmu izmanto šādas iespējas - "-s", kas nozīmē "apkopot" un "h", kas padara produkciju cilvēkam lasāmu. You can also use this command to see the details of the files and directories inside a directory. Jūs varat arī izmantot šo komandu, lai redzētu ar failiem un direktoriju detaļas iekšā direktorijā. To see the individual and total disk of usage or files and directories inside the “data” directory do the following: Lai redzētu individuālās un kopējās diska izmantošanas vai failus un direktorijas iekšpuses "dati" direktoriju izdarīt šādi:

# du -shc data/* # Du-SHC data / *
4.0K data/1log_script.sh 4.0K data/1log_script.sh
64K data/logs_files 64K data / logs_files
4.0K data/generic_script.sh 4.0K data / generic_script.sh
8.0K data/random_script1.sh 8.0K data/random_script1.sh
4.0K data/random_script2.sh 4.0K data/random_script2.sh
4.0K data/random_script3.sh 4.0K data/random_script3.sh
4.0K data/hello_world.sh 4.0K data / hello_world.sh
4.0K data/data_backup.log 4.0K data / data_backup.log
4.0K data/log_backup.log 4.0K data / log_backup.log
100K total 100K kopā

We have added the option “c” to the previously used command. Mēs esam pievienojuši iespēju "c", kas iepriekš izmantotas komandu. “c” adds total disk usage at the end. "C" piebilst kopējais diska izmantošana beigās.

Another tool that I use to checkout what's on my disk is the “find” command. Vēl viens instruments, I use pasūtījumu, kas ir uz mana diska ir "find" komandu. Using find I like to make a list of all the files over a certain size. Izmantojot atrast es vēlētos izteikt saraksts failus noteiktu lielumu. Say I wanted to check to see which files in my '/home' partition are larger than 10 MB, here's what I would use: Teikt, es gribēju pārbaudīt, lai redzētu, kuri faili manā '/ home' nodalījums ir lielāks par 10 MB, lūk, ko es varētu izmantot:

# find /home -size +10000k # Atradīsiet / home-size 10.000 k

The command is pretty self-explanatory. Komanda ir diezgan self-explanatory. You can change the “/home” to the directory you want to scan for files, and the “+10000k” to the size of file you want to filter it by. Jūs varat mainīt "/ home", lai katalogā jūs vēlaties meklēt failus un "10.000 k" ar izmēru failu, kuru vēlaties filtrēt, ko tai.

Hope you find these useful. Ceru, ka jūs atrast šos noderīga.

Related Posts: Related Posts:
  • How to securely clean up data on a hard disk on Linux Kā droši attīrītu datus no cietā diska uz Linux
  • How to determine where all of your free disk space has gone in OS X Kā noteikt, kur visu savu brīvo diska vietas aizgāja OS X
  • How to repair disk permissions in OS X Kā labot disk permissions OS X
  • Use Auslogics Disk Defrag to defragment your Windows hard drive faster Izmantojiet Auslogics Disk Defrag to defragment Windows cieto disku ātrāk
  • How to analyze disk usage in Ubuntu Kā analizēt diska izmantošana Ubuntu
  • Get Simple Help tutorials just like this one in your email inbox every day - for free! Get Simple Palīdzība konsultācijas tāpat kā šo vienu savā e-pastā ik dienas - bez maksas! Just enter your email address below: Vienkārši ievadiet savu e-pasta adresi:

    You can always opt out of this email subscription at any time. Jūs vienmēr varat atteikties no šīs e-pasta abonementu jebkurā laikā.

    { 2 comments… read them below or (2 comments ... lasīt tos zem vai add one pievienot vienu } )

    1 1 Hamdoon 03.14.09 at 12:49 am At 12:49 03.14.09 Hamdoon am

    Hellow, Hellow,
    I'm programmer in developer 6i ,and i have system to develope it but there are some problems.This system designed by developer 6i and required to display hard disk free space for Linux inside text tool. Es esmu programmētājs 6i attīstītājs, un man ir attīstības sistēmu, bet ir dažas problems.This izveidotā sistēma attīstītājs 6i un kas nepieciešami, lai parādītu cietā diska brīvā vieta Linux iekšpusē teksta rīks. So How can i display it . Tātad, kā es varu to parādītu.
    please replay the the solution to my email (hamdon85@yahoo.com)> lūdzu replay risinājums manu e-pastu (hamdon85@yahoo.com)>

    Thanks Pateicība
    Hamdoon. Hamdoon.

    2 2 imtiaz ali Imtiaz ali 09.03.09 at 8:10 am 09.03.09 at 8:10

    plz tell me how to display free space in linux OS. plz man pastāstīt, kā parādīt brīva vieta Linux OS. i will wait. man būs jāgaida.

    Leave a Comment Leave Comment

    You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> Jūs varat izmantot šos HTML tagus un atribūtus: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>