Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ajt (2546)

  (email not shown publicly)

UK based. Perl, XML/HTTP, SAP, Debian hacker.

  • PerlMonks: ajt []
  • Local LUG: AdamTrickett []
  • Debian Administration: ajt []
  • LinkedIn: drajt []

Journal of ajt (2546)

Thursday February 23, 2006
01:54 PM

Perl To The Rescue (again)

[ #28788 ]

At work one of the NT admins wanted to know the file size of a bunch of files on various servers. It's a trivial task, he could search the whole domain, check each server manually from Explorer, or script it.

On a POSIX like platform, it's a trivial one-liner, easily done in shell/awk, or any other scripting language like Perl. On Windows, DOS just can't do it, so we installed ActiveState Perl, and then a I gave them a small script to do it. I'll probably do some more scripts for them, they have serious space issues, and we're using Perl to find duplicated files in the main filesystems, and deleting files over 30 days old on transfer file systems.

It's tasks like that, that remind me why I use Perl and why I mostly work on POSIX like systems.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Yep; that's why I can't live without Cygwin. (And Perl.)

    J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
    • Cygwin was my second option too. Very useful tool Cygwin - makes Windows almost usable.

      -- "It's not magic, it's work..."
      • With Cygwin and Firefox, I often forget I am using Windows while at work. Of course, it helps that almost every window I have up is an ssh to some UNIX platform.

        J. David works really hard, has a passion for writing good software, and knows many of the world's best Perl programmers
        • I know the feeling.

          PuTTY, Cygwin/X and Firefox make Windows almost usable. I often run PuTTY full screen and then use GNU screen on one of the Linux servers to multiplex between the various Linux/AIX boxen I work with. Other days I run Cygwin/X full screen and use a window manager on one of the Linux boxen, you can run KDE or GNOME quite well - though it's not as fast as running locally.

          I'm hoping IT will allow me to run Linux as a desktop at long last* via a KVM, then all I need on my Windows PC is Loo

          -- "It's not magic, it's work..."
  • Windows has an optional tool called logparser which I've been using for just this task. It's really rather cool (which I find painful to say). Once installed something like this..

    logparser "SELECT TOP 100 * FROM d:\*.* ORDER BY Size DESC" -i:FS

    To show the top 100 files by size on the d:\ drive. It can produce output in text, excel spreadsheet, xml, gif (pie chart) and loads more.

    I've also used it to mine IIS log files on windows boxen. Really worth a look.