Re: [gentoo-user] locating large disk files

2014-07-13 Thread Michael Orlitzky
On 07/13/2014 04:03 PM, Joseph wrote:
 I'm trying to clean up my home directory by locating large disk files. I used:
 find / -type f -size +2k -exec ls -lh {} \; | awk '{ print $8 :  $5 }'
 
 but I'm getting strange output:

Just use du -h instead of ls -lh and awk:

  find / -type f -size +2k -exec du -h {} \;




Re: [gentoo-user] locating large disk files

2014-07-13 Thread Tuomo Hartikainen
On 140713 1403, Joseph wrote:
 I'm trying to clean up my home directory by locating large disk files. I used:
 find / -type f -size +2k -exec ls -lh {} \; | awk '{ print $8 :  $5 }'
 
 but I'm getting strange output:
 13:57: 194M
 ...

Try

find / -type f -size +2k -exec ls -lh {} \; | awk '{ print $9 :  $5 }'

instead?
-- 
Tuomo Hartikainen


signature.asc
Description: Digital signature


Re: [gentoo-user] locating large disk files

2014-07-13 Thread Jc GarcĂ­a
2014-07-13 14:19 GMT-06:00 Michael Orlitzky m...@gentoo.org:
 On 07/13/2014 04:03 PM, Joseph wrote:
 I'm trying to clean up my home directory by locating large disk files. I 
 used:
 find / -type f -size +2k -exec ls -lh {} \; | awk '{ print $8 :  $5 }'

 but I'm getting strange output:

 Just use du -h instead of ls -lh and awk:

   find / -type f -size +2k -exec du -h {} \;



I usually use du and find, or the like, for this porpouse, but
recently stumbled upon the sys-apps/baobab (also known as gnome disk
usage tool) tool which does a nice job at locating those large files,
and giving you a nice graph of usage of diretories, pretty useful in
my opinion, and I don't think you need to install the entire gnome to
use it. give it a look for me it changed the way I do this particular
task.



Re: [gentoo-user] locating large disk files

2014-07-13 Thread Dimitri Semitsoglou-Tsiapos
On Sun, 13 Jul 2014 14:03:41 -0600
Joseph syscon...@gmail.com wrote:

 I'm trying to clean up my home directory by locating large disk
 files. I used: find / -type f -size +2k -exec ls -lh {} \; | awk
 '{ print $8 :  $5 }'

Take a look here regarding why you should never parse ls' output:
http://mywiki.wooledge.org/ParsingLs

You can use ncdu or xdiskusage (both available in portage) to get more
useful output. Both will allow you to track down large folders, not
just single files (for example cache folders tend to hold a large
amount of tiny files, which may collectively amount for a large chunk
of your hard disk space).



Re: [gentoo-user] locating large disk files

2014-07-13 Thread Neil Bothwick
On Sun, 13 Jul 2014 14:03:41 -0600, Joseph wrote:

 I'm trying to clean up my home directory by locating large disk files.
 I used: find / -type f -size +2k -exec ls -lh {} \; | awk '{ print
 $8 :  $5 }'
 
 but I'm getting strange output:
 13:57: 194M
 2011: 57M
 17:05: 31M

File name with spaces will result in awk returning the wrong field, or at
least not the field you expected. Use du as suggested elsewhere.


-- 
Neil Bothwick

New Intel opcode #007 PUKE: Put unmeaningful keywords everywhere


signature.asc
Description: PGP signature


Re: [gentoo-user] locating large disk files

2014-07-13 Thread Joseph

On 07/13/14 23:25, Dimitri Semitsoglou-Tsiapos wrote:

On Sun, 13 Jul 2014 14:03:41 -0600
Joseph syscon...@gmail.com wrote:


I'm trying to clean up my home directory by locating large disk
files. I used: find / -type f -size +2k -exec ls -lh {} \; | awk
'{ print $8 :  $5 }'


Take a look here regarding why you should never parse ls' output:
http://mywiki.wooledge.org/ParsingLs

You can use ncdu or xdiskusage (both available in portage) to get more
useful output. Both will allow you to track down large folders, not
just single files (for example cache folders tend to hold a large
amount of tiny files, which may collectively amount for a large chunk
of your hard disk space).



Thanks folks, so in this case I guess:
find / -type f -size +2k -exec du -h {} \;

is the winner (it does the trick).

--
Joseph



Re: [gentoo-user] locating large disk files

2014-07-13 Thread Erik Mackdanz
Instead of '-exec ls' I recommend the -ls or -printf switches.  If you
really require the human-formatted size, you can also just quote {} properly.

Joseph syscon...@gmail.com writes:

 I'm trying to clean up my home directory by locating large disk files. I used:
 find / -type f -size +2k -exec ls -lh {} \; | awk '{ print $8 :  $5 }'

 but I'm getting strange output:
 13:57: 194M
 2011: 57M
 17:05: 31M
 2011: 27M
 06:02: 41M
 11:31: 21M
 11:39: 28M
 22:02: 62M
 2012: 26M
 12:53: 104M
 2012: 26M
 16:33: 127M
 21:28: 104M
 20:21: 61M
 06:20: 96M
 2011: 21M
 08:07: 26M
 2011: 37M
 2011: 28M
 19:34: 93M
 2013: 42M
 20:54: 33M
 2013: 40M
 06:04: 26M
 19:42: 190M
 10:00: 47M
 13:43: 1.3G
 10:38: 41M
 14:31: 41M
 16:24: 711M
 2012: 27M
 08:21: 251M
 2011: 44M
 13:53: 651M
 07:40: 46M
 13:23: 49M
 13:41: 355M
 10:41: 20M
 2013: 32M
 ...

 -- 
 Joseph


-- 
Erik Mackdanz



Re: [gentoo-user] locating large disk files

2014-07-13 Thread Bruce Schultz
On 14 July 2014 6:53:30 AM AEST, Joseph syscon...@gmail.com wrote:
On 07/13/14 23:25, Dimitri Semitsoglou-Tsiapos wrote:
On Sun, 13 Jul 2014 14:03:41 -0600
Joseph syscon...@gmail.com wrote:

 I'm trying to clean up my home directory by locating large disk
 files. I used: find / -type f -size +2k -exec ls -lh {} \; | awk
 '{ print $8 :  $5 }'

Take a look here regarding why you should never parse ls' output:
http://mywiki.wooledge.org/ParsingLs

You can use ncdu or xdiskusage (both available in portage) to get more
useful output. Both will allow you to track down large folders, not
just single files (for example cache folders tend to hold a large
amount of tiny files, which may collectively amount for a large chunk
of your hard disk space).


Thanks folks, so in this case I guess:
find / -type f -size +2k -exec du -h {} \;

is the winner (it does the trick).

Pipe that through sort -h to get the files sorted by size

-- 
:B