* Re: [gentoo-user] locating large disk files
2014-07-13 20:03 [gentoo-user] locating large disk files Joseph
@ 2014-07-13 20:19 ` Michael Orlitzky
2014-07-13 20:25 ` Jc García
2014-07-13 20:24 ` Tuomo Hartikainen
` (3 subsequent siblings)
4 siblings, 1 reply; 9+ messages in thread
From: Michael Orlitzky @ 2014-07-13 20:19 UTC (permalink / raw
To: gentoo-user
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 +20000k -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 +20000k -exec du -h {} \;
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] locating large disk files
2014-07-13 20:19 ` Michael Orlitzky
@ 2014-07-13 20:25 ` Jc García
0 siblings, 0 replies; 9+ messages in thread
From: Jc García @ 2014-07-13 20:25 UTC (permalink / raw
To: gentoo-user
2014-07-13 14:19 GMT-06:00 Michael Orlitzky <mjo@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 +20000k -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 +20000k -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.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] locating large disk files
2014-07-13 20:03 [gentoo-user] locating large disk files Joseph
2014-07-13 20:19 ` Michael Orlitzky
@ 2014-07-13 20:24 ` Tuomo Hartikainen
2014-07-13 20:25 ` Dimitri Semitsoglou-Tsiapos
` (2 subsequent siblings)
4 siblings, 0 replies; 9+ messages in thread
From: Tuomo Hartikainen @ 2014-07-13 20:24 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 377 bytes --]
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 +20000k -exec ls -lh {} \; | awk '{ print $8 ": " $5 }'
>
> but I'm getting strange output:
> 13:57: 194M
> ...
Try
find / -type f -size +20000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
instead?
--
Tuomo Hartikainen
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] locating large disk files
2014-07-13 20:03 [gentoo-user] locating large disk files Joseph
2014-07-13 20:19 ` Michael Orlitzky
2014-07-13 20:24 ` Tuomo Hartikainen
@ 2014-07-13 20:25 ` Dimitri Semitsoglou-Tsiapos
2014-07-13 20:53 ` Joseph
2014-07-13 20:47 ` Neil Bothwick
2014-07-14 0:12 ` Erik Mackdanz
4 siblings, 1 reply; 9+ messages in thread
From: Dimitri Semitsoglou-Tsiapos @ 2014-07-13 20:25 UTC (permalink / raw
To: gentoo-user
On Sun, 13 Jul 2014 14:03:41 -0600
Joseph <syscon780@gmail.com> wrote:
> I'm trying to clean up my home directory by locating large disk
> files. I used: find / -type f -size +20000k -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).
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] locating large disk files
2014-07-13 20:25 ` Dimitri Semitsoglou-Tsiapos
@ 2014-07-13 20:53 ` Joseph
2014-07-14 0:19 ` Bruce Schultz
0 siblings, 1 reply; 9+ messages in thread
From: Joseph @ 2014-07-13 20:53 UTC (permalink / raw
To: gentoo-user
On 07/13/14 23:25, Dimitri Semitsoglou-Tsiapos wrote:
>On Sun, 13 Jul 2014 14:03:41 -0600
>Joseph <syscon780@gmail.com> wrote:
>
>> I'm trying to clean up my home directory by locating large disk
>> files. I used: find / -type f -size +20000k -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 +20000k -exec du -h {} \;
is the winner (it does the trick).
--
Joseph
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] locating large disk files
2014-07-13 20:53 ` Joseph
@ 2014-07-14 0:19 ` Bruce Schultz
0 siblings, 0 replies; 9+ messages in thread
From: Bruce Schultz @ 2014-07-14 0:19 UTC (permalink / raw
To: gentoo-user
On 14 July 2014 6:53:30 AM AEST, Joseph <syscon780@gmail.com> wrote:
>On 07/13/14 23:25, Dimitri Semitsoglou-Tsiapos wrote:
>>On Sun, 13 Jul 2014 14:03:41 -0600
>>Joseph <syscon780@gmail.com> wrote:
>>
>>> I'm trying to clean up my home directory by locating large disk
>>> files. I used: find / -type f -size +20000k -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 +20000k -exec du -h {} \;
>
>is the winner (it does the trick).
Pipe that through sort -h to get the files sorted by size
--
:B
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] locating large disk files
2014-07-13 20:03 [gentoo-user] locating large disk files Joseph
` (2 preceding siblings ...)
2014-07-13 20:25 ` Dimitri Semitsoglou-Tsiapos
@ 2014-07-13 20:47 ` Neil Bothwick
2014-07-14 0:12 ` Erik Mackdanz
4 siblings, 0 replies; 9+ messages in thread
From: Neil Bothwick @ 2014-07-13 20:47 UTC (permalink / raw
To: gentoo-user
[-- Attachment #1: Type: text/plain, Size: 534 bytes --]
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 +20000k -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
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [gentoo-user] locating large disk files
2014-07-13 20:03 [gentoo-user] locating large disk files Joseph
` (3 preceding siblings ...)
2014-07-13 20:47 ` Neil Bothwick
@ 2014-07-14 0:12 ` Erik Mackdanz
4 siblings, 0 replies; 9+ messages in thread
From: Erik Mackdanz @ 2014-07-14 0:12 UTC (permalink / raw
To: gentoo-user
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 <syscon780@gmail.com> writes:
> I'm trying to clean up my home directory by locating large disk files. I used:
> find / -type f -size +20000k -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
^ permalink raw reply [flat|nested] 9+ messages in thread