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. Хоча простір жорсткого диска дешевих сьогодні, і ми радісно кинути в кілька сотень гігабайт на сервері або на робочому столі, це дивно, як часто отримує диск повністю. 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. Ось деякі інструменти Linux, щоб допомогти вам дізнатися, скільки на диску було з'їдено, і що їдять його, так що ви можете зробити щось до того, як він виходить з-під контролю.
The first command we'll look at is the “df” command. Першою командою ми будемо дивитися на це команда "DF". It comes bundled with all distributions of Linux. Він поставляється в комплекті з усіма розподілів Linux. “df” stands for “disk free”. "DF" означає "вільний диск". It gives you a reading of the state of all your partitions. Це дає вам читання стан всіх розділів. It gives you the total disk space, the used space, the space available, and then the percentage of space being used. Вона дає загальне дисковий простір, що використовується простір, простір є, а потім частки простору використовуються.
# df -h # DF-H
Filesystem Size Used Avail Use% Mounted on Файлова система Розмір Б Вільно Використовуйте% встановлена на
/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 83М 12% / завантаження
/dev/sda2 15G 1.3G 13G 10% /home / Dev/sda2 15G 1.3G 13G 10% / Home
The is the kind of reading you can get from df. Це вид читання можна отримати DF. In the above example I have used the option “-h” which gives the output in a human-readable format. У наведеному вище прикладі я використав опцію "-H", яка дає результати в зручній для сприйняття людиною формі. So, instead of showing me the disk space in bytes it uses megabytes and gigabytes which is easier for us to interpret. Таким чином, замість того, щоб показати мені місце на диску в байтах вона використовує мегабайти та гігабайти якої нам легше інтерпретувати.
Another command I find a lot of use for is “du”. Інша команда, я знаходжу багато для використання є "Du". “du” stands for “disk usage”. "Du" розшифровується як "Використання диска". It can give you a reading of the amount of space a file or folder is using up. Він може дати вам читання обсяг простору, файл або папка використовується вгору. To check the amount of space being consumed by a directory called 'data' use the following command: Щоб перевірити обсяг простору споживаються директорію з ім'ям "дані" використовувати таку команду:
# du -sh data # Дю-SH дані
104K data/ 104K дані /
For the above command I have used the following options – “-s” which stands for “summarize”, and “h”, which makes the output human-readable. За вказаними вище команди я використовував наступні опції - "-S", яке розшифровується як "резюме" і "H", яка робить вихідну людського розуміння. You can also use this command to see the details of the files and directories inside a directory. Ви також можете використовувати цю команду, щоб побачити подробиці файли і каталоги всередині каталогу. To see the individual and total disk of usage or files and directories inside the “data” directory do the following: Щоб побачити індивідуальне і загальне використання диска або файли і каталоги всередині каталогу "дані" виконайте наступні дії:
# du -shc data/* # Дю-SHC дані / *
4.0K data/1log_script.sh 4.0K data/1log_script.sh
64K data/logs_files 64K дані / logs_files
4.0K data/generic_script.sh 4.0K дані / 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 дані / hello_world.sh
4.0K data/data_backup.log 4.0K дані / data_backup.log
4.0K data/log_backup.log 4.0K дані / log_backup.log
100K total Всього 100K
We have added the option “c” to the previously used command. Ми додали опцію "С" з раніше використовуваної команди. “c” adds total disk usage at the end. "С", додає загальне використання диска на кінці.
Another tool that I use to checkout what's on my disk is the “find” command. Іншим інструментом, який я використовую для виїзду, що на моєму диску команду "Пошук". Using find I like to make a list of all the files over a certain size. Використання знайти Я хотів би скласти список всіх файлів, що перевищують певний розмір. Say I wanted to check to see which files in my '/home' partition are larger than 10 MB, here's what I would use: Скажи мені хотілося, щоб перевірити, які файли в моїй "/ розділ Home 'розміром більше 10 Мб, ось що я хотів би використовувати:
# find /home -size +10000k # Пошук / Будинок розміром 10000 K
The command is pretty 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. Ви можете змінити "/ Home" в каталозі ви хочете сканувати файли, а "10000 K" до розміру файлу, який ви хочете відфільтрувати її.
Hope you find these useful. Сподіваюся, ви знайдете їх корисними.























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. Я програміст розробник 6i, і я системою для розробки, але є деякі problems.This система розроблена Developer 6i і необхідних для відображення жорсткому диску вільного місця для Linux усередині інструменту тексту. So How can i display it . Як же я можу показати його.
please replay the the solution to my email (hamdon85@yahoo.com)> Будь ласка, Replay рішення на мою адресу (hamdon85@yahoo.com)>
Thanks Спасибо
Hamdoon. Хамдун.
plz tell me how to display free space in linux OS. PLZ скажіть мені, як для відображення вільного місця в ОС Linux. i will wait. Я буду чекати.