Sponsored Content
Operating Systems Solaris Modifying the contents of a file and saving it Post 302733265 by Avik Datta on Tuesday 20th of November 2012 04:13:45 AM
Old 11-20-2012
Thanks a ton

Thanks a ton guys..it was really helpful.
I do have another challange. My file abc.log has the content:
-----------
Code:
Tablespace                      Size (GB)  Free (GB)     % Free     % Used      
------------------------------ ---------- ---------- ---------- ----------      
WMHAIT_IS                               8          8        100          0      
WMHA_IM                               .98        .97         99          1      
WMHA_IS                               .98         .9         93          7      
WMHA_DS                             10.98        9.5         87         13      
WMHAPP_IS                              .1        .08         85         16      
WMHAPP_DS                            8.93       7.19         80         20      
WMHAIT_DS                              32      24.05         75         25      
WMHA_DM                               348      37.49         11         89

Question: What command should I use to get the below output
(only the last 3 lines):

Tablespace Size (GB) Free (GB) % Free % Used
------------------------------ ---------- ---------- ---------- ------- WMHAPP_DS 8.93 7.19 80 20
WMHAIT_DS 32 24.05 75 25
WMHA_DM 348 37.49 11 89

Last edited by Avik Datta; 11-30-2012 at 12:00 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

can someone help me with modifying this file

Hi, I have a file which has data kind of like this. Apr 13 08:20:38 uslis10a sendmail: m3DDKSx3006432: usliss26.ca.com Apr 13 08:20:38 uslis10b sendmail: m3DDKSoK006433: usliss26.ca.com Apr 13 08:20:38 uslis10b sendmail: m3DDKcSo006442: usliss26.ca.com Apr 13 08:20:38 uslis10c... (2 Replies)
Discussion started by: eamani_sun
2 Replies

2. Shell Programming and Scripting

Modifying file from outside

hi , I have a javascript file like this: function fnValidateId(){ var array_id = new Array("444","7888","6633","555","146562","3333","33332") var tmp_id = document.form1.id.value; var num=0; while(1) { if(tmp_id ==... (9 Replies)
Discussion started by: Sreejith_VK
9 Replies

3. Shell Programming and Scripting

Retain file permissions when saving .sh file from internet [OS X]

Hello. I have written a bash script that I am sharing with an OS X community I am a member of. The purpose of the script is to execute a series of commands for members without them having to get involved with Terminal, as it can be daunting for those with no experience of it at all. I have renamed... (4 Replies)
Discussion started by: baza210
4 Replies

4. Shell Programming and Scripting

Modifying a file?

Hi, I want to convert a file that looks like this >joe XXXXXXXXXXXXXXXXXXX >man BBBBBBBBBBBBBBBBBBBBBSSSSSSSS to something that looks like this (where the spacing is tab seperated) joe XXXXXXXXXXXXXXXXXXX man BBBBBBBBBBBBBBBBBBBBBSSSSSSSS I am able to do the reverse but the other... (3 Replies)
Discussion started by: kylle345
3 Replies

5. UNIX for Dummies Questions & Answers

compare 2 file contents , if same delete 2nd file contents

Give shell script....which takes two file names as input and compares the contents, is both are same delete second file's contents..... I try with "diff"...... but confusion how to use "diff" with if ---else Thanking you (5 Replies)
Discussion started by: krishnampkkm
5 Replies

6. Shell Programming and Scripting

I want to delete the contents of a file which are matching with contents of other file

Hi, I want to delete the contents of a file which are matching with contents of other file in shell scripting. Ex. file1 sheel,sumit,1,2,3,4,5,6,7,8 sumit,rana,2,3,4,5,6,7,8,9 grade,pass,2,3,4,5,6,232,1,1 name,sur,33,1,4,12,3,5,6,8 sheel,pass,2,3,4,5,6,232,1,1 File2... (3 Replies)
Discussion started by: ranasheel2000
3 Replies

7. Shell Programming and Scripting

Replace partial contents of file with contents read from other file

Hi, I am facing issue while reading data from a file in UNIX. my requirement is to compare two files and for the text pattern matching in the 1st file, replace the contents in second file by the contents of first file from start to the end and write the contents to thrid file. i am able to... (2 Replies)
Discussion started by: seeki
2 Replies

8. Programming

[Solved] Removing duplicates from the file and saving as new file

Dear All I have 200 data files and each files has many duplicates. I am looking for the automated awk script such that it checks and removes the duplicates from the each file and saving them as new files for all 200 files in the respective folder. For example my data looks like this.. ... (12 Replies)
Discussion started by: bala06
12 Replies

9. Shell Programming and Scripting

Folder contents getting appended as strings while redirecting file contents to a variable

Hi one of the output of the command is as below # sed -n "/CCM-ResourceHealthCheck:/,/---------/{/CCM-ResourceHealthCheck:/d;/---------/d;p;}" Automation.OutputZ$zoneCounter | sed 's/$/<br>/' Resource List : <br> *************************** 1. row ***************************<br> ... (2 Replies)
Discussion started by: vivek d r
2 Replies

10. Shell Programming and Scripting

Modifying contents of the file in shell script

Hello all, I have a Kconfig file that looks like something below ... ================================ menu "Application type" config GUI_TYPE_STANDARD bool "Standard Application" source "cfg/config/std.in" source... (12 Replies)
Discussion started by: anand.shah
12 Replies
E2FREEFRAG(8)						      System Manager's Manual						     E2FREEFRAG(8)

NAME
e2freefrag - report free space fragmentation information SYNOPSIS
e2freefrag [ -c chunk_kb ] [ -h ] filesys DESCRIPTION
e2freefrag is used to report free space fragmentation on ext2/3/4 file systems. filesys is the filesystem device name (e.g. /dev/hdc1, /dev/md0). The e2freefrag program will scan the block bitmap information to check how many free blocks are present as contiguous and aligned free space. The percentage of contiguous free blocks of size and of alignment chunk_kb is reported. It also displays the mini- mum/maximum/average free chunk size in the filesystem, along with a histogram of all free chunks. This information can be used to gauge the level of free space fragmentation in the filesystem. OPTIONS
-c chunk_kb If a chunk size is specified, then e2freefrag will print how many free chunks of size chunk_kb are available in units of kilobytes (Kb). The chunk size must be a power of two and be larger than filesystem block size. -h Print the usage of the program. EXAMPLE
# e2freefrag /dev/vgroot/lvhome Device: /dev/vgroot/lvhome Blocksize: 4096 bytes Total blocks: 1504085 Free blocks: 292995 (19.5%) Min. free extent: 4 KB Max. free extent: 24008 KB Avg. free extent: 252 KB HISTOGRAM OF FREE EXTENT SIZES: Extent Size Range : Free extents Free Blocks Percent 4K... 8K- : 704 704 0.2% 8K... 16K- : 810 1979 0.7% 16K... 32K- : 843 4467 1.5% 32K... 64K- : 579 6263 2.1% 64K... 128K- : 493 11067 3.8% 128K... 256K- : 394 18097 6.2% 256K... 512K- : 281 25477 8.7% 512K... 1024K- : 253 44914 15.3% 1M... 2M- : 143 51897 17.7% 2M... 4M- : 73 50683 17.3% 4M... 8M- : 37 52417 17.9% 8M... 16M- : 7 19028 6.5% 16M... 32M- : 1 6002 2.0% AUTHOR
This version of e2freefrag was written by Rupesh Thakare, and modified by Andreas Dilger <adilger@sun.com>, and Kalpak Shah. SEE ALSO
debugfs(8), dumpe2fs(8), e2fsck(8) E2fsprogs version 1.41.14 December 2010 E2FREEFRAG(8)
All times are GMT -4. The time now is 10:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy