473,608 Members | 2,479 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Monitor the disk usage using perl without pakages

1 New Member
se strict;
use warnings;
my $x = <STDIN>;

foreach my $x ( sort glob('$x/*') ) {
my($dev,$ino,$m ode,$nlink,$uid ,$gid,$rdev,$si ze,$atime,$mtim e,$ctime,$blksi ze,$blocks)
= stat($x);
printf("%-40s %8u bytes\n", $x, $size);
}
Sep 1 '18 #1
1 3901
zmbd
5,501 Recognized Expert Moderator Expert
Rajesh Anumula:
Simple requests for code are not what we're about at Bytes.com
If you have a specific problem - we're happy to help.
If you have tried something already, then post your code; however, please use the [CODE/] format tool to format your script.
Sep 1 '18 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1248
by: omkar prabhu | last post by:
i am using postgres 7.0.3 and also postgres 7.2.1 I am new towards using blobs,I want to transfers records with blobs from a table to different database(postgres) using perl without extracting the blob to disk(i.e without using lo_export/lo_import). Below is my perl script which is not working can
6
2548
by: Matthew Nuzum | last post by:
We've had a chance to talk to some of our competitors who have recently gone out of business. One of the major failings that contributed to their collapse was not accurately understanding how much disk space and bandwidth they were using up. Therefore, they often lost money unexpectedly which, as most of you know, is not sustainable. Therefore, we'd like to avoid falling into the same trap and get a good understanding of how much...
5
4444
by: Excluded_Middle | last post by:
Hi, I am trying to connect to db2 database and want to execute some basic SQL commands like create or select. I am on linux 7 redhat distribution and I have no rights to compile perl or install some thing that is big in size as I am student. I just want to experiment db2 and php or perl. any link or suggestions ?
12
2411
by: Sankar | last post by:
Dear all, I am programming in Linux , wherein I need to know a couple of things. 1) Does an API exist that can copy file onto another file ( an API equivalent of 'cp') ? 2) Is there an API that tells me the disk usage ( equivalent for cmdline
5
18401
by: soulofstar | last post by:
I want to monitor the CPU and RAM usage using Python, Now, I know how to monitor RAM usage by Python from ctypes import * from ctypes.wintypes import * class MEMORYSTATUS(Structure): _fields_ = def winmem():
4
13030
by: isha123 | last post by:
how can i find the cpu usage of my windows XP SP2 machine from command line? And also how can i execute this command with Perl? or is there anyother way to find CPU usage for XP machine using Perl?
0
1647
by: garks | last post by:
I am using Exchange 2003(Exchange Hosting), C#. I am trying to get Mailbox usage using WMI But I follows the coding below, still cannot get the Mailbox usage. Even though, I predefined the username and password. Often gets "Access denied" while running the code. I have tried to add the user to the \root\MicrosoftExchangeV2, and the delegate control, but still cannot. Is there anything I missing to add?
6
14392
by: nb999 | last post by:
Hello All, I need to find disk space on one of my drives in windows machine using perl. But, I cant seem to find windows command that I can script. I have performed similar task for unix machine using system call and then parsing the data obtained. system("df -k"); Does anyone know any similar command for windows?
3
1553
Srijith B
by: Srijith B | last post by:
Hi, I have a code which maintains a certain partition in of my SD card. The code will -> Warn if the free space is less than 2% -> Else prints a complement statement I want the program to print these details only when a copying or moving operation is done.
3
7552
by: omakhileshchand | last post by:
Sir, I have a text file that contain some fields,the fields are given below:- "","7041","8320","hunt_incoming","7041","SIP/ccm102-00000001","","Read","REPFLOW,/usr/WINAST/PRAMERICA/ENGLISH/PREVIOUSMENU,1,,1,5","2011-05-03 03:21:57","2011-05-03 03:21:59","2011-05-03 03:22:36",39,37,"ANSWERED","DOCUMENTATION","1304392917.1","" I want to insert that fields into a table using perl.I'm getting problem with particular fields...
0
8059
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8495
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8145
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8330
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6815
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5475
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3960
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2474
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
1328
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.