Check Total Size of Multiple File

Masalah: Nak kira total saiz file2 tertentu

Contoh korang dalam dir /home/user/..dalam tu ada macam2 file..tapi korang hanya nak kira saiz file2 tertentu sahaja. Contohnya dlm dir tu ada file gambar1, gambar2, gambar3. tapi korang nak kira total saiz gambar1 dan gambar3 sahaja. So commandnya..

du -ch gambar1 gambar3 | grep total

Penerangan
du =
disk usage
c =
calculate (calculate multiple files and display the total amount)
h =
display size in human readable format (Kilobytes, Megabytes, Gigabytes)

Selamat mencuba dan selamat beramal.

Advertisements
This entry was posted in Linux and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s