Shlomif's Technical Posts Community - Cygwin and Perl Save the Day! [entries|archive|friends|userinfo]
Shlomif's Technical Posts Community

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

[Links:| Shlomi Fish's Homepage Main Journal Homesite Blog Planet Linux-IL Amir Aharoni in Unicode open dot dot dot ]

Cygwin and Perl Save the Day! [Dec. 31st, 2009|10:14 am]
Previous Entry Add to Memories Share Next Entry


[Tags|, , , , , , , ]
[Current Location |Home]
[Current Music |Alphaville - Forever Young]

In my house, we have a Windows XP desktop computer that serves the family (while I'm normally using my Linux desktop machine.). A few days ago my father complained that drive C:\ there, which contains all the programs is almost completely occupied, and said we need to remove programs from it. Now this drive is roughly 45 GB in size, so it seemed unlikely to me that it became entirely full because of the executables.

I decided to investigate. I switched to my account, started a cygwin shell, and ran \du . > ~/du.txt from the C:\. What du does is report the size of every directory starting from the input path recursively. Then I ran my du-output-analyser written in Perl to analyse the results, and eventually found out that 20,000,000 (20 million) 1 KB blocks are being occupied by a directory containing photos. Then I sent a report for my father announcing it.

This just goes to show how much people who are not familiar with the UNIX command line and with programming are missing and are much more helpless than the more clueful UNIX power-users.


From: (Anonymous)
2009-12-31 11:43 am (UTC)

GetOpt::Long usage style


You might like this link,

Cheers from another Perl fan!
[User Picture]From: shlomif
2010-01-02 10:32 am (UTC)

Re: GetOpt::Long usage style


I don't understand how it's related to what I said. Furthermore it's "Getopt::Long" (with two lowercase "o"'s) - not "GetOpt::Long" (with one uppercase "o"):

$ perl -MGetOpt::Long
Can't locate GetOpt/ in @INC

"GetOpt::Long" may work on Windows, but it won't on Unix.

[User Picture]From:
2009-12-31 02:28 pm (UTC)

Not just for Linux hackers


I am sorry to tell you, but while I am being a Linux fan, I know Windows has applications which can show directory usage in a graphical user interface.
[User Picture]From: shlomif
2010-01-02 10:36 am (UTC)

Re: Not just for Linux hackers


Maybe, but by using the command-line and my programming skills, I was able to emulate it to my preferences without depending on the whims of a GUI creator, and the limitations of the GUI. And I didn't have to install anything extraneous, and now can run the statistical analysis on the same data times again. And it worked perfectly fine on Windows - not on Linux.