LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 09-01-2008, 11:35 PM   #1
crions
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)

Anyone???
 
Old 09-01-2008, 11:54 PM   #2
abhigrkist
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, 11: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-02-2008, 12:01 AM   #4
pixellany
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-02-2008, 12:22 AM   #5
crions
LQ Newbie
 
Registered: May 2005
Location: Home
Distribution: slackware/ubuntu
Posts: 17

Original Poster
Rep: Reputation: 1
Question

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

NOTE:
/folder/place/sub1/
/folder/place/sub2/
/folder/place/sub3/
.
.
.



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-02-2008, 12:27 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

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


Reply


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 08:16 PM
Copying File Hierarchy with Specific Filetype Inner City Blues Linux - Newbie 2 09-11-2007 05:24 PM
Using WGET to download specific filetype itz2000 Linux - Newbie 3 02-03-2007 05:49 AM
Prevent a specific filetype from being created? Phaethar Linux - Security 0 02-17-2005 12:49 PM
trying to determine the size of all files in a directory riddlebox80 Programming 7 06-11-2003 08:27 PM


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

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