How to find large file size on Unix

/ November 6th, 2010/ Posted in Computer, Server / 381 Comments »

ใช้ Code ตามนี้หาเลย

find / -type f -size +1000000k -exec ls -lh {} \; | awk ‘{ print $9 ” : ” $5 }’

+1000000k บอกว่า ไฟล์มากกว่า 1 GB
awk ‘{ print $9 ” : ” $5 }’  print ข้อความของ -exec ls -lh {}

-exec ls -lh {} คือ Execute ls option -lh
{} คือ ทำเป็น Array โดยเริ่มที่ Index ที่ 1 (index 0 คือ output ของทั้ง Line)


Tags: ,

Leave a Reply

You must be logged in to post a comment.