Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-01-2008, 10:35 PM   #1
LQ Newbie
Registered: May 2005
Location: Home
Distribution: slackware/ubuntu
Posts: 17

Rep: Reputation: 1
Angry How to find and determine size of specific filetype

I want to 'du' some specific filetype.
How much space all .exe files occupy on /folder/place/ (recursively)

Old 09-01-2008, 10:54 PM   #2
LQ Newbie
Registered: Sep 2008
Posts: 8

Rep: Reputation: 0
do that
du `find /folder/place -name "*.exe" `
plz check that it is working or not............
Old 09-01-2008, 10:59 PM   #3
Mr. C.
Senior Member
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
find . -type f -name "*.exe" -printf "%s\n" | awk '{total += $1} END {print total}'
Old 09-01-2008, 11:01 PM   #4
LQ Veteran
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Why not:
du /folder/place/ *.exe

To get a total:
du -c ..etc
Old 09-01-2008, 11:22 PM   #5
LQ Newbie
Registered: May 2005
Location: Home
Distribution: slackware/ubuntu
Posts: 17

Original Poster
Rep: Reputation: 1

Did not work:
du `find /folder/place -name "*.exe"
du /folder/place/ *.exe (not recursively)


Fine but not "HUMAN":
find . -type f -name "*.exe" -printf "%s\n" | awk '{total += $1} END {print total}'

Returns: 1406813686

Is there a -h on it (like ls -lha)?
Old 09-01-2008, 11:27 PM   #6
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Just use division.
 find . -type f -name "*.exe" -printf "%s\n" | awk '{total += $1} END {print total/(1024*1024) " MB"}


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to determine block size when using dd kav Linux - Software 2 12-22-2007 07:16 PM
Copying File Hierarchy with Specific Filetype Inner City Blues Linux - Newbie 2 09-11-2007 04:24 PM
Using WGET to download specific filetype itz2000 Linux - Newbie 3 02-03-2007 04:49 AM
Prevent a specific filetype from being created? Phaethar Linux - Security 0 02-17-2005 11:49 AM
trying to determine the size of all files in a directory riddlebox80 Programming 7 06-11-2003 07:27 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:23 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration