Calculate total space, total used space and total free space in filesystem names matching keyword
Good afternoon! Im new at scripting and Im trying to write a script to
calculate total space, total used space and total free space in filesystem names matching a keyword (in this one we will use keyword virginia). Please dont be mean or harsh, like I said Im new and trying my best. Scripting doesnt come easy for me.
So this is what Im trying to write specifically:
- Calculate the sum of total space, used space for all matching filesystems
- Display "Total Space = xx " ; "Used Space = yy"; "Free space = zz"
Thanks in advance for any help!
BigBen
Last edited by bigben1220; 11-24-2009 at 07:15 PM..
Reason: code tags, please...
I don't get why you ask since you only accept 'oracle' and nothing else. It is not needed. I am assuming that there are directories in your file system(s) named 'oracle'
If the match is really '*oracle*' then change this code to match:
I don't know what NR is supposed to do. NR is the number of records. It has nothing to do with free space or used space either. Used space is produced by bdf. Free space is total - used. s/NR divides the free space by the number of directories or filesystems.
Hi
I am trying to calculate memory used by Linux System
free -m
total used free shared buffers cached
Mem: 32109 31010 1099 0 3600 7287
-/+ buffers/cache: 20121 11987
Swap: 10239 1282 8957
Now according to my requirement Im calculating memory using below cmd
free -m | awk 'NR==3{printf... (2 Replies)
Hi,
Could you please tell me the commands to find Total storage space and Serial number of Linux server.
OS -- Red Hat Enterprise Linux Server release 6.6 (Santiago)
This is 2 node cluster.
Regards,
Maddy (1 Reply)
Hi Everyone,
I try to calculate the total hard disk space of a solaris machine using iostat -En command. Iterating the output and summing up all the number present near the Size: will give the exact size of the harddisk. But it is not working for a machine.
This command works in many flavors... (2 Replies)
Hi Experts,
In a particular dir, I have many files *AJAY*.
How can I get total size of all such files.
I tried du -hs *AJAY* but it gave me individual size of all files.
All I require is summation of all.
Thanks,
Ajay (4 Replies)
Hi experts,
In my solaris system when i run the command df -h i got the below response.I have some confusion which i want to share with you guys.1)there are two SWAP file system shows are they same or different?2)if i want to count the total disk space should i take both the swap space or only... (2 Replies)
Hi,
I see from lsvg the total used PPs is 1050 (67200 megabytes), but when I check the disk space with df command I can only see 31G total space, can somebody tell how this come?
Thanks!
Victor
# lsvg
rootvg
# lsvg rootvg
VOLUME GROUP: rootvg VG IDENTIFIER: ... (2 Replies)
Hi All,
Will df+du=Total space allocted for a file system??
Is the above correct. Please correct me If iam wrong.
In one my programs the above is not happening.
Please help me out.
Many thanks.
Regards,
Manas (2 Replies)