<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:media="http://search.yahoo.com/mrss/" >

<channel>
	<title>tìm thư mục nặng nhất &#8211; AnonyViet</title>
	<atom:link href="https://anonyviet.com/tag/tim-thu-muc-nang-nhat/feed/" rel="self" type="application/rss+xml" />
	<link>https://anonyviet.com</link>
	<description>Webiste chia sẻ kiến thức công nghệ thông tin, mạng máy tính, bảo mật phổ biến nhất Việt Nam. Luôn cập nhật tin tức, thủ thuật nóng hổi nhất</description>
	<lastBuildDate>Thu, 24 Jul 2025 16:01:50 +0000</lastBuildDate>
	<language>vi</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	

<image>
	<url>https://anonyviet.com/wp-content/uploads/2018/10/cropped-ico-logo-75x75.png</url>
	<title>tìm thư mục nặng nhất &#8211; AnonyViet</title>
	<link>https://anonyviet.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Cách tìm File/Folder lớn nhất trên Linux</title>
		<link>https://anonyviet.com/cach-tim-file-folder-lon-nhat-tren-linux/</link>
					<comments>https://anonyviet.com/cach-tim-file-folder-lon-nhat-tren-linux/#respond</comments>
		
		<dc:creator><![CDATA[AnonyViet]]></dc:creator>
		<pubDate>Thu, 23 Mar 2023 02:37:41 +0000</pubDate>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[Tìm file]]></category>
		<category><![CDATA[tìm folder]]></category>
		<category><![CDATA[tìm thư mục lớn nhất]]></category>
		<category><![CDATA[tìm thư mục nặng nhất]]></category>
		<guid isPermaLink="false">https://anonyviet.com/?p=45978</guid>

					<description><![CDATA[Nếu bạn đang dùng Linux, chắc hẵn sẽ gặp tình trạng ổ cứng bị chiếm dung lượng nhưng không biết file hay folder nào đang nặng nhất để tìm và xóa bớt. Trên Linux, có sẵn các lệnh giúp bạn tìm File/Folder lớn nhất. Với sự kết hợp 3 lệnh du, sort và head sẽ [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Nếu bạn đang dùng Linux, chắc hẵn sẽ gặp tình trạng ổ cứng bị chiếm dung lượng nhưng không biết file hay folder nào đang nặng nhất để tìm và xóa bớt. Trên Linux, có sẵn các lệnh giúp bạn tìm File/Folder lớn nhất. Với sự kết hợp 3 lệnh <code>du</code>, <code>sort</code> và <code>head</code> sẽ giúp bạn nhanh chóng liệt kê ra các dữ liệu đang chiếm dung lượng ổ cứng trên Linux hay VPS của bạn.</p>
<ol>
<li>Lệnh <code>du</code>: xác định dung lượng sử dụng</li>
<li>Lệnh <code>sort</code>: sort lại các dòng của file text hoặc input data</li>
<li>Lệnh <code>head</code>: output dữ liệu từ trên xuống, ví dụ lấy 10 dòng đầu tiên chẳng hạn</li>
</ol>
<p>Kiểm tra dung lượng của thư mục <code>/home/</code> nếu muốn kiểm tra dung lượng thư mục root thì thay thành <code>/root/</code></p>
<pre>du -sh /home/</pre>
<p>Sử dụng lệnh bên dưới để tìm 10 file/thư mục có dung lượng lớn nhất. Thay <code>/home</code> bằng đường dẫn bạn muốn</p>
<pre>du -a /home/ | sort -n -r | head -n 10</pre>
<p>Output ví dụ:</p>
<pre>589700 /home
589696 /home/anonyviet.com
526988 /home/anonyviet.com/public_html
506628 /home/anonyviet.com/public_html/wp-content
385096 /home/anonyviet.com/public_html/wp-content/uploads
179988 /home/anonyviet.com/public_html/wp-content/uploads/2014
117072 /home/anonyviet.com/public_html/wp-content/uploads/2013
74212 /home/anonyviet.com/public_html/wp-content/plugins
47296 /home/anonyviet.com/public_html/wp-content/uploads/2012
43100 /home/anonyviet.com/public_html/wp-content/cache</pre>
<p>Nếu bạn muốn đổi dung lượng <strong>byte</strong> thành <strong>MB, KB t</strong>hì dùng lệnh sau:</p>
<pre>cd /home
du -hsx * | sort -rh | head -10</pre>
<p>Các lệnh trên chỉ sử dụng được khi Linux có cài đặt gói <code>sort</code>, nếu không thì bạn có thể dùng lệnh dưới đây:</p>
<pre>for i in G M K; do du -ah | grep [0-9]$i | sort -nr -k 1; done | head -n 11</pre>
<p>Output ví dụ:</p>
<pre>179M	.
84M	./uploads
57M	./images
51M	./images/a
49M	./images/abc/2013
47M	./uploads/def
37M	./videos/gha/2013/12
37M	./videos/gha/2013
37M	./videos/gha
36M	./videos
35M	./uploads/gha</pre>
<p><strong>Lệnh tìm kiếm các file lớn nhất trong 1 Folder:</strong></p>
<p>Tìm kiếm file lớn nhất trong Folder<code> /home</code></p>
<pre>find /home -printf '%s %p\n'| sort -nr | head -10
</pre>
<p>Tìm kiếm file lớn nhất trong Folder hiện tại</p>
<p><code>find . -printf '%s %p\n'| sort -nr | head -10</code></p>
<p>Output ví dụ:</p>
<pre>5700875 ./images/faq/2023/11/iftop-outputs.gif
5459671 ./videos/faq/2023/12/glances/glances.webm
5091119 ./videos/faq/2023/12/glances/glances.ogv
4706278 ./images/faq/2023/09/cyberciti.biz.linux.wallpapers_r0x1.tar.gz
3911341 ./videos/faq/2023/12/vim-exit/vim-exit.ogv
3640181 ./videos/faq/2023/12/python-subprocess/python-subprocess.webm
3571712 ./images/faq/2023/12/glances-demo-large.gif
3222684 ./videos/faq/2023/12/vim-exit/vim-exit.mp4
3198164 ./videos/faq/2023/12/python-subprocess/python-subprocess.ogv
3056537 ./images/faq/2023/08/debian-as-parent-distribution.png.bak</pre>
<p>Để chỉ hiển thị file, không hiển thị Folder thì các bạn dùng lệnh:</p>
<pre>find /path -type f -printf '%s %p\n'| sort -nr | head -10</pre>
<p>hoặc</p>
<pre>find /path -type f -iname "*.mp4" -printf '%s %p\n'| sort -nr | head -10</pre>
<ul>
<li>Tìm thư mục lớn nhất trong Linux</li>
<li>Tìm thư mục nặng nhất trong Linux</li>
<li>Tìm folder lớn nhất trong Linux</li>
<li>Tìm folder nặng nhất trong Linux</li>
<li>Tìm file lớn nhất trong Linux</li>
<li>Tìm file nặng nhất trong Linux</li>
</ul>
<p style="text-align: right;"><em>Tham khảo: hocvps.com</em></p>
<h2>Câu hỏi thường gặp</h2>
<h3>Tôi có thể tìm file/folder lớn nhất ở đâu trên hệ thống Linux của mình?</h3>
<p>Bạn có thể sử dụng lệnh <code>du -sh /path/to/directory</code> để xem tổng dung lượng của một thư mục.  Để tìm 10 file/folder lớn nhất, hãy dùng lệnh <code>du -a /path/to/directory | sort -n -r | head -n 10</code>. Thay <code>/path/to/directory</code> bằng đường dẫn thư mục mong muốn.</p>
<h3>Làm thế nào để chuyển đổi đơn vị dung lượng (bytes) sang MB hoặc KB?</h3>
<p>Sử dụng lệnh <code>du -hsx * | sort -rh | head -10</code>  trong thư mục bạn muốn kiểm tra. Lệnh này sẽ hiển thị kích thước theo đơn vị MB, KB.</p>
<h3>Nếu tôi chỉ muốn tìm file lớn nhất (không phải thư mục), tôi nên làm gì?</h3>
<p>Hãy sử dụng lệnh <code>find /path -type f -printf '%s %p\n'| sort -nr | head -10</code>.  Thay <code>/path</code> bằng đường dẫn thư mục bạn muốn tìm kiếm.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://anonyviet.com/cach-tim-file-folder-lon-nhat-tren-linux/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
