User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Linux Users Lounge section within the Tech Talk category of DaniWeb, a massive community of 402,860 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,955 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Linux Users Lounge advertiser: Lunarpages Linux Web Hosting
Views: 3905 | Replies: 3
Reply
Join Date: Oct 2006
Posts: 158
Reputation: tech291083 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
tech291083 tech291083 is offline Offline
Junior Poster

Checking size of file/folders

  #1  
Oct 16th, 2007
Hi,

I the following two command give the names of the folder of files on the desktop which have their size in MB or GB, am I right?

[root@localhost Desktop]# du -h |grep M

[root@localhost Desktop]# du -h |grep G


What do I need to use as a command to get the name of the files/folders within a particular range in terms of size ie MB or GB? If I want to know the names of the files/folders on the desktop that are larger than 5 MB but less then 10 MB in size? Thanks..
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Oct 2007
Posts: 8
Reputation: jansson is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 2
jansson jansson is offline Offline
Newbie Poster

Re: Checking size of file/folders

  #2  
Oct 16th, 2007
Originally Posted by tech291083 View Post
I the following two command give the names of the folder of files on the desktop which have their size in MB or GB, am I right?

[root@localhost Desktop]# du -h |grep M

[root@localhost Desktop]# du -h |grep G


Well, yes and no, you get ALL lines displaying a 'M' or a 'G'. That is, files like 'superMarket.sh' or
'GreyFloor.jpg' would also be printed. It will also do the check recursive, so if you just want the size of the things actually "on" the Desktop to be printed, you'll have to ad the option '-s' to du (for more info check #man du).

Unfortunately I can't come up with any good solutions, but hopefully someone else will help you with the rest of the cake.

/jansson
Reply With Quote  
Join Date: Nov 2007
Posts: 2
Reputation: andrei6200 is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
andrei6200 andrei6200 is offline Offline
Newbie Poster

Re: Checking size of file/folders

  #3  
Nov 30th, 2007
You could use a program called "ncdu", that computes recursively the size of all files and folders somewhere on your disk... And you can browse the list and then delete the big unnecessary files
Reply With Quote  
Join Date: Jan 2007
Location: Ireland
Posts: 1,579
Reputation: DimaYasny will become famous soon enough DimaYasny will become famous soon enough 
Rep Power: 6
Solved Threads: 66
Featured Poster
DimaYasny DimaYasny is offline Offline
Posting Virtuoso

Re: Checking size of file/folders

  #4  
Nov 30th, 2007
man find
Real stupidity always beats Artificial Intelligence. (Terry Pratchett)

BA BizMg, MCSE, DCSE, Linux+, Network+
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Linux Users Lounge Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Linux Users Lounge Forum

All times are GMT -4. The time now is 1:19 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC