Skip to content


df tylko dla globals

Wersja polska wkróce.

#!/usr/bin/ksh
#
# W.M.Duszyk 2/20/11
# list file systems from the global environment only
#

df -g $* | grep -v wpar
# Filesystem    GB blocks      Free %Used    Iused %Iused Mounted on
/dev/cda_lv      120.00     42.85   65%    40408     1% /cda
/dev/stage_lv    110.00      9.96   91%     6162     1% /ilmstage

#!/usr/bin/perl -w
use strict;
#
# by Waldemar Mark Duszyk/Silicon Logic Ltd.
# 03/06/2003
#
my @fileSystems = `df -k | grep -v wpar`;
my $cntr;
my @tokens;
my $gbUsed;
my $FSsize;
my $FSfree;
my $Pused;

format STDOUT =
@<<<<<<<<<<<<<<<<<@>>>>>>>>>@>>>>>>>>>>>@>>>>>>>@>>>>>>>>> @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $tokens[0],$FSsize,$FSfree,$Pused,$gbUsed,$tokens[6] . print "Filesystem Total Size(GB) Free(GB) \%Used Used(GB) Mounted on\n"; for ($cntr = 1; $cntr <= $#fileSystems; $cntr++) { my $holder = $fileSystems[$cntr]; @tokens = split (/\s+/, $holder); if (( $tokens[1] eq '-') && ( $tokens[2] eq '-')) { $gbUsed = '-'; $FSsize = '-'; $FSfree = '-'; $Pused = '-'; } else { $gbUsed = (( $tokens[1] - $tokens[2] ) / 1048576.0); $gbUsed = sprintf ("%.3f", $gbUsed); $FSsize = $tokens[1] / 1048576.0; $FSsize = sprintf ("%.3f", $FSsize); $FSfree = $tokens[2] / 1048576.0; $FSfree = sprintf ("%.3f", $FSfree); $Pused = $tokens[3]; } write; }

Posted in AIX, Real life AIX, wpar.

Tagged with , , , , , .


0 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.



Some HTML is OK

or, reply to this post via trackback.

WordPress Anti Spam by WP-SpamShield



Copyright © 2016 - 2017 Waldemar Mark Duszyk. All Rights Reserved. Created by Blog Copyright.