{"id":548,"date":"2025-09-10T12:47:59","date_gmt":"2025-09-10T09:47:59","guid":{"rendered":"https:\/\/destek.narhost.com\/?p=548"},"modified":"2026-09-12T15:11:15","modified_gmt":"2026-09-12T12:11:15","slug":"linux-klasor-boyutu-ogrenme","status":"publish","type":"post","link":"https:\/\/narhost.com\/destek\/linux-klasor-boyutu-ogrenme\/","title":{"rendered":"Linux&#8217;ta Klas\u00f6r Boyutu Nas\u0131l \u00d6\u011frenilir (du -sh)"},"content":{"rendered":"<p class=\"kb-dogrulama\">Son do\u011frulama: Eyl\u00fcl 2026 \u00b7 Ubuntu 24.04 test sunucusunda denendi<\/p>\n<div id=\"hizli-cozum\" class=\"ai-box ai-box--cozum\">\n<p class=\"ai-box-title\">H\u0131zl\u0131 \u00e7\u00f6z\u00fcm<\/p>\n<p><strong>Linux klas\u00f6r boyutu \u00f6\u011frenme<\/strong> i\u015fleminin en pratik yolu <code>du -sh &lt;klas\u00f6r&gt;<\/code> komutudur; <code>-s<\/code> yaln\u0131zca \u00f6zet toplam\u0131, <code>-h<\/code> boyutu KB\/MB\/GB gibi okunabilir birimde g\u00f6sterir. Bir dizinin alt\u0131ndaki her alt klas\u00f6r\u00fc ayr\u0131 ayr\u0131 g\u00f6rmek i\u00e7in <code>du -h --max-depth=1 &lt;klas\u00f6r&gt; | sort -rh<\/code> kullan\u0131n.<\/p>\n<ol>\n<li><code>du -sh \/var\/log<\/code> gibi bir komutla tek bir klas\u00f6r\u00fcn toplam boyutunu g\u00f6r\u00fcn.<\/li>\n<li>En \u00e7ok yer kaplayan alt klas\u00f6rleri bulmak i\u00e7in <code>du -h --max-depth=1 \/var | sort -rh<\/code> \u00e7al\u0131\u015ft\u0131r\u0131n.<\/li>\n<li>Genel disk dolulu\u011funu <code>df -h<\/code> ile kar\u015f\u0131la\u015ft\u0131r\u0131p klas\u00f6r boyutunun diskin ne kadar\u0131n\u0131 kaplad\u0131\u011f\u0131n\u0131 anlay\u0131n.<\/li>\n<\/ol>\n<\/div>\n<table class=\"kb-uyg\">\n<tr>\n<th>Panel<\/th>\n<td>Yok \u2014 VPS\/VDS y\u00f6netimsizdir; i\u015flem i\u015fletim sistemi \u00fczerinden yap\u0131l\u0131r<\/td>\n<\/tr>\n<tr>\n<th>Sistem<\/th>\n<td>Ubuntu 22.04\/24.04, Debian 12, AlmaLinux 8\/9, Rocky 9 (coreutils <code>du<\/code> her da\u011f\u0131t\u0131mda yerle\u015fik)<\/td>\n<\/tr>\n<tr>\n<th>Yetki<\/th>\n<td>Sunucunuzun herhangi bir kullan\u0131c\u0131s\u0131; sistem klas\u00f6rleri i\u00e7in sudo gerekebilir<\/td>\n<\/tr>\n<tr>\n<th>Narhost \u00fcr\u00fcn\u00fc<\/th>\n<td><a href=\"https:\/\/narhost.com\/vps-sunucu\" title=\"Narhost VPS Sunucu paketleri\">VPS Sunucu<\/a>, VDS Sunucu<\/td>\n<\/tr>\n<\/table>\n<div class=\"kb-once\">\n<p class=\"label\">Ba\u015flamadan \u00f6nce<\/p>\n<ul>\n<li>Sunucunuza SSH ile ba\u011fl\u0131 olun.<\/li>\n<li>\u00d6l\u00e7mek istedi\u011finiz klas\u00f6r\u00fcn tam yolunu bilin (<code>pwd<\/code> ile bulundu\u011funuz dizini g\u00f6rebilirsiniz).<\/li>\n<li>\u00c7ok b\u00fcy\u00fck dizinlerde (\u00f6r. k\u00f6k <code>\/<\/code>) <code>du<\/code> taramas\u0131n\u0131n birka\u00e7 dakika s\u00fcrebilece\u011fini unutmay\u0131n.<\/li>\n<\/ul>\n<\/div>\n<h2>Linux Klas\u00f6r Boyutu \u00d6\u011frenme Ne \u0130\u015fe Yarar<\/h2>\n<p>Linux klas\u00f6r boyutu \u00f6\u011frenme ihtiyac\u0131 genellikle disk dolulu\u011fu bir uyar\u0131ya ya da hataya d\u00f6n\u00fc\u015ft\u00fc\u011f\u00fcnde ortaya \u00e7\u0131kar: hangi dizinin diskin \u00e7o\u011funu kaplad\u0131\u011f\u0131n\u0131 bulmadan yer a\u00e7mak m\u00fcmk\u00fcn de\u011fildir. <code>ls -l<\/code> yaln\u0131zca dosya boyutlar\u0131n\u0131 listeler, alt klas\u00f6rleri toplamaz; <code>du<\/code> (disk usage) komutu ise bir dizin a\u011fac\u0131ndaki t\u00fcm dosyalar\u0131 toplay\u0131p ger\u00e7ek disk kullan\u0131m\u0131n\u0131 verir.<\/p>\n<p><code>du<\/code> ile <code>df<\/code> farkl\u0131 \u015feyler \u00f6l\u00e7er: <code>df -h<\/code> bir dosya sisteminin (b\u00f6l\u00fcm\u00fcn) toplam dolulu\u011funu g\u00f6sterir, <code>du -sh &lt;klas\u00f6r&gt;<\/code> ise o dosya sistemi i\u00e7indeki tek bir klas\u00f6r\u00fcn ne kadar yer kaplad\u0131\u011f\u0131n\u0131 g\u00f6sterir. Disk dolu uyar\u0131s\u0131 ald\u0131\u011f\u0131n\u0131zda \u00f6nce <code>df -h<\/code> ile hangi b\u00f6l\u00fcm\u00fcn doldu\u011funu, sonra <code>du<\/code> ile o b\u00f6l\u00fcm alt\u0131nda hangi klas\u00f6r\u00fcn su\u00e7lu oldu\u011funu bulursunuz.<\/p>\n<figure class=\"nh-sema\"><img src=\"https:\/\/narhost.com\/destek\/wp-content\/uploads\/2026\/09\/linux-klasor-boyutu-ogrenme-sema-narhost.webp\" alt=\"Linux klas\u00f6r boyutu \u00f6\u011frenme ak\u0131\u015f \u015femas\u0131 \u2014 du -sh ile \u00f6l\u00e7\u00fcm, alt klas\u00f6r s\u0131ralama, k\u00f6k dizin taramas\u0131 ve disk dolulu\u011fu kar\u015f\u0131la\u015ft\u0131rma ad\u0131mlar\u0131\" width=\"1200\" height=\"500\" loading=\"lazy\" decoding=\"async\"><figcaption>Tek klas\u00f6rden disk dolulu\u011funa d\u00f6rt ad\u0131m: du ve df ile su\u00e7lu klas\u00f6r\u00fc bulun.<\/figcaption><\/figure>\n<h2>Ad\u0131m Ad\u0131m Klas\u00f6r Boyutu \u00d6l\u00e7me<\/h2>\n<h3>1. Tek Bir Klas\u00f6r\u00fcn Toplam Boyutunu G\u00f6r\u00fcn<\/h3>\n<ol class=\"kb-adimlar\">\n<li><strong>Klas\u00f6r yolunu belirterek \u00e7al\u0131\u015ft\u0131r\u0131n:<\/strong>\n<pre><code class=\"language-bash\">du -sh \/var\/log<\/code><\/pre>\n<p class=\"kb-cikti\">Beklenen sonu\u00e7 (test sunucusunda al\u0131nan ger\u00e7ek \u00e7\u0131kt\u0131): <code>48M \/var\/log<\/code>. <code>-s<\/code> alt klas\u00f6rleri tek toplamda birle\u015ftirir, <code>-h<\/code> bayt\u0131 insan taraf\u0131ndan okunabilir birime (K\/M\/G) \u00e7evirir.<\/p>\n<\/li>\n<li><strong>Klas\u00f6r\u00fcn i\u00e7ine girip parametresiz de \u00e7al\u0131\u015ft\u0131rabilirsiniz:<\/strong>\n<pre><code class=\"language-bash\">cd \/etc && du -sh<\/code><\/pre>\n<p class=\"kb-cikti\">Beklenen sonu\u00e7 (test sunucusunda al\u0131nan ger\u00e7ek \u00e7\u0131kt\u0131): <code>6.3M .<\/code> \u2014 bulundu\u011funuz dizinin toplam boyutu.<\/p>\n<\/li>\n<\/ol>\n<h3>2. En B\u00fcy\u00fck Alt Klas\u00f6rleri S\u0131ralay\u0131n<\/h3>\n<ol class=\"kb-adimlar\">\n<li><strong>Bir \u00fcst dizindeki t\u00fcm alt klas\u00f6rleri boyuta g\u00f6re s\u0131ralay\u0131n:<\/strong>\n<pre><code class=\"language-bash\">du -h --max-depth=1 \/var | sort -rh<\/code><\/pre>\n<p class=\"kb-cikti\">Beklenen sonu\u00e7 (test sunucusunda al\u0131nan ger\u00e7ek \u00e7\u0131kt\u0131, k\u0131salt\u0131lm\u0131\u015f): <code>378M \/var<\/code>, <code>188M \/var\/lib<\/code>, <code>141M \/var\/cache<\/code>, <code>48M \/var\/log<\/code>, <code>1.0M \/var\/backups<\/code>. <code>--max-depth=1<\/code> yaln\u0131zca bir seviye alt klas\u00f6r\u00fc sayar, <code>sort -rh<\/code> insan-okunabilir boyutlar\u0131 b\u00fcy\u00fckten k\u00fc\u00e7\u00fc\u011fe dizer.<\/p>\n<\/li>\n<li><strong>Ayn\u0131 s\u0131ralamay\u0131 k\u00f6k dizinde tekrarlayarak hangi ana klas\u00f6r\u00fcn diski doldurdu\u011funu bulun:<\/strong>\n<pre><code class=\"language-bash\">du -h --max-depth=1 \/ 2>\/dev\/null | sort -rh | head -10<\/code><\/pre>\n<p class=\"kb-cikti\">Beklenen sonu\u00e7: <code>\/var<\/code>, <code>\/usr<\/code>, <code>\/home<\/code> gibi klas\u00f6rler boyuta g\u00f6re s\u0131ral\u0131 listelenir; <code>2&gt;\/dev\/null<\/code> izin hatas\u0131 veren sistem dizinlerinin ekran\u0131 kirletmesini engeller.<\/p>\n<\/li>\n<\/ol>\n<h3>3. Genel Disk Dolulu\u011fuyla Kar\u015f\u0131la\u015ft\u0131r\u0131n<\/h3>\n<ol class=\"kb-adimlar\">\n<li><strong>Dosya sistemlerinin toplam doluluk oran\u0131n\u0131 g\u00f6r\u00fcn:<\/strong>\n<pre><code class=\"language-bash\">df -h<\/code><\/pre>\n<p class=\"kb-cikti\">Beklenen sonu\u00e7 (test sunucusunda al\u0131nan ger\u00e7ek \u00e7\u0131kt\u0131, k\u0131salt\u0131lm\u0131\u015f): <code>\/dev\/mapper\/ubuntu--vg-ubuntu--lv 196G 3.9G 184G 3% \/<\/code>. &#8220;Use%&#8221; s\u00fctunu b\u00f6l\u00fcm\u00fcn ne kadar\u0131n\u0131n dolu oldu\u011funu g\u00f6sterir; bir klas\u00f6r\u00fcn <code>du<\/code> ile \u00f6l\u00e7t\u00fc\u011f\u00fcn\u00fcz boyutunu bu toplamla kar\u015f\u0131la\u015ft\u0131rarak oran\u0131n\u0131 anlars\u0131n\u0131z.<\/p>\n<\/li>\n<\/ol>\n<h2>Do\u011frulama<\/h2>\n<div class=\"success-box\">\n<p class=\"label\">Sonu\u00e7<\/p>\n<p><code>du -sh &lt;klas\u00f6r&gt;<\/code> bekledi\u011finiz b\u00fcy\u00fckl\u00fckte bir say\u0131 d\u00f6nd\u00fcr\u00fcyor ve <code>du -h --max-depth=1<\/code> \u00e7\u0131kt\u0131s\u0131ndaki alt klas\u00f6r toplamlar\u0131 \u00fcst klas\u00f6r\u00fcn toplam\u0131na yak\u0131nsa (birka\u00e7 MB&#8217;l\u0131k fark normaldir, ayn\u0131 anda de\u011fi\u015fen dosyalardan kaynaklan\u0131r) \u00f6l\u00e7\u00fcm do\u011frudur.<\/p>\n<\/div>\n<h2>H\u00e2l\u00e2 \u00c7\u00f6z\u00fclmediyse<\/h2>\n<ul>\n<li><strong>&#8220;Permission denied&#8221; hatalar\u0131 \u00e7\u0131kt\u0131y\u0131 kirletiyor.<\/strong> Sistem klas\u00f6rlerinde <code>sudo du -sh &lt;klas\u00f6r&gt;<\/code> kullan\u0131n ya da hatalar\u0131 <code>2&gt;\/dev\/null<\/code> ile gizleyin.<\/li>\n<li><strong>du \u00e7ok yava\u015f \u00e7al\u0131\u015f\u0131yor.<\/strong> \u00c7ok say\u0131da k\u00fc\u00e7\u00fck dosya i\u00e7eren bir dizindesinizdir (\u00f6r. e-posta kuyru\u011fu, log ar\u015fivi); <code>du<\/code> her dosyay\u0131 tek tek okur, bu normal bir gecikmedir.<\/li>\n<li><strong>Boyutu \u00f6l\u00e7t\u00fcm ama disk h\u00e2l\u00e2 dolu g\u00f6r\u00fcn\u00fcyor.<\/strong> Silinmi\u015f ama h\u00e2l\u00e2 bir s\u00fcre\u00e7 taraf\u0131ndan a\u00e7\u0131k tutulan dosyalar disk alan\u0131n\u0131 serbest b\u0131rakmaz; ilgili servisi <a href=\"https:\/\/narhost.com\/destek\/linux-servisini-durdurma-ve-aktif-etme\/\" title=\"Linux'ta Servis Nas\u0131l Durdurulur ve Aktif Edilir (systemctl) \u2014 Narhost Destek\">yeniden ba\u015flatman\u0131z<\/a> gerekebilir.<\/li>\n<li><strong>Disk ger\u00e7ekten yetersiz kald\u0131.<\/strong> B\u00fcy\u00fckl\u00fc\u011f\u00fc art\u0131rmak i\u00e7in <a href=\"https:\/\/narhost.com\/destek\/ubuntu-xfs-disk-genisletme\/\" title=\"Ubuntu'da XFS Disk Nas\u0131l Geni\u015fletilir (VPS \u0130lk Kurulum 8\/10) \u2014 Narhost Destek\">disk geni\u015fletme ad\u0131m\u0131na<\/a> ge\u00e7in.<\/li>\n<\/ul>\n<div class=\"cta-box\">\n<p class=\"label\">Narhost deste\u011fi<\/p>\n<p>Talebe \u015funlar\u0131 ekleyin: sunucunuzun IP adresi, \u00f6l\u00e7t\u00fc\u011f\u00fcn\u00fcz klas\u00f6r yolu, <code>du -sh<\/code> ve <code>df -h<\/code> \u00e7\u0131kt\u0131lar\u0131n\u0131n tamam\u0131.<\/p>\n<p><a class=\"cta-btn\" href=\"https:\/\/narhost.com\/submitticket.php\" title=\"Narhost destek talebi olu\u015ftur\">Destek talebi a\u00e7<\/a><\/div>\n<div class=\"kb-ilgili\">\n<p class=\"label\">Sonraki ad\u0131mlar<\/p>\n<ul>\n<li><a href=\"https:\/\/narhost.com\/destek\/vps-vds-ilk-kurulum-rehberi\/\" title=\"VPS VDS Sunucu \u0130lk Kurulum Rehberi (10 Ad\u0131mda G\u00fcvenli Kurulum) \u2014 Narhost Destek\">VPS VDS ilk kurulum rehberinin tamam\u0131<\/a><\/li>\n<li><a href=\"https:\/\/narhost.com\/destek\/linux-sunucuda-disk-kullanimi-nasil-denetlenir\/\" title=\"Linux Sunucuda Disk Kullan\u0131m\u0131 Nas\u0131l Denetlenir (df, du) \u2014 Narhost Destek\">Genel disk kullan\u0131m\u0131n\u0131 denetleme (df, du)<\/a><\/li>\n<li><a href=\"https:\/\/narhost.com\/destek\/ubuntu-xfs-disk-genisletme\/\" title=\"Ubuntu'da XFS Disk Nas\u0131l Geni\u015fletilir (VPS \u0130lk Kurulum 8\/10) \u2014 Narhost Destek\">Disk geni\u015fletme (VPS ilk kurulum 8\/10)<\/a><\/li>\n<li><a href=\"https:\/\/narhost.com\/destek\/swap-alani-nasil-olusturulur\/\" title=\"Swap Alan\u0131 Nas\u0131l Olu\u015fturulur \u2014 Narhost Destek\">Swap alan\u0131 olu\u015fturma<\/a><\/li>\n<\/ul>\n<\/div>\n<div class=\"kb-faq\">\n<h2>S\u0131k\u00e7a sorulan sorular<\/h2>\n<h3>du ile ls -la ayn\u0131 \u015feyi mi g\u00f6sterir?<\/h3>\n<p>Hay\u0131r. <code>ls -la<\/code> her dosyan\u0131n kendi boyutunu listeler ve alt klas\u00f6rleri toplamaz; <code>du -sh<\/code> ise bir dizin a\u011fac\u0131ndaki t\u00fcm dosyalar\u0131 toplayarak ger\u00e7ek disk kullan\u0131m\u0131n\u0131 verir.<\/p>\n<h3>du -sh \u00e7\u0131kt\u0131s\u0131 ile dosya y\u00f6neticisindeki boyut neden farkl\u0131 \u00e7\u0131kabilir?<\/h3>\n<p><code>du<\/code> diskte fiilen ayr\u0131lan blok boyutunu sayar, baz\u0131 aray\u00fczler ise dosyalar\u0131n &#8220;mant\u0131ksal&#8221; boyutunu g\u00f6sterir; k\u00fc\u00e7\u00fck dosyalarda blok yuvarlamas\u0131 y\u00fcz\u00fcnden birka\u00e7 KB fark normaldir.<\/p>\n<h3>En b\u00fcy\u00fck tek tek dosyalar\u0131 nas\u0131l bulurum, klas\u00f6r de\u011fil?<\/h3>\n<p><code>du<\/code> yerine <code>find &lt;klas\u00f6r&gt; -type f -exec du -h {} + | sort -rh | head -10<\/code> komutuyla bir dizindeki en b\u00fcy\u00fck tekil dosyalar\u0131 listeleyebilirsiniz. Komutun t\u00fcm parametreleri <a href=\"https:\/\/man7.org\/linux\/man-pages\/man1\/du.1.html\" title=\"du (disk usage) resmi man sayfas\u0131 (man7.org)\" target=\"_blank\" rel=\"noopener\">du&#8217;nun resmi man sayfas\u0131nda<\/a> listelidir.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>Linux klas\u00f6r boyutu \u00f6\u011frenme: du -sh, du &#8211;max-depth=1 | sort -rh ile en b\u00fcy\u00fck alt klas\u00f6rleri bulma ve df -h ile disk dolulu\u011funu kar\u015f\u0131la\u015ft\u0131rma, ger\u00e7ek komut \u00e7\u0131kt\u0131lar\u0131yla.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,13],"tags":[237],"class_list":["post-548","post","type-post","status-publish","format-standard","hentry","category-vds-server","category-vps-server","tag-du"],"meta_box":[],"_links":{"self":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts\/548","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/comments?post=548"}],"version-history":[{"count":4,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts\/548\/revisions"}],"predecessor-version":[{"id":848,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/posts\/548\/revisions\/848"}],"wp:attachment":[{"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/media?parent=548"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/categories?post=548"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/narhost.com\/destek\/wp-json\/wp\/v2\/tags?post=548"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}