Sponsored Content
Top Forums Shell Programming and Scripting Help me grab a passage out of this text file? Post 302583522 by Corona688 on Tuesday 20th of December 2011 03:03:47 PM
Old 12-20-2011
Code:
$ awk '/Defragmentation Summary/; /^Disk Size/ { P=1 } P; /^Fragmentation After/ { exit }' < fragsummary
Disk Defragmentation Summary
Disk Size 230.85 GB
Free Space Size 189.82 GB
Clusters 60514815
Sectors per cluster 8
Bytes per sector 512
Started defragmentation at 12/13/2011 1:22:16 PM
Completed defragmentation at 12/13/2011 1:23:00 PM
Elapsed time 00:00:43
Total Files 78490
Total Directories 19205
Fragmented Files 274
Defragmented Files 274
Skipped Files 0
Fragmentation Before 0.82% |
Fragmentation After 0.00%
$

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

How to Grab the latest file

I have been trying to use the find command to grab the latest file in a directory and move it to another area. I can't seem to get only that file, I end up getting everything for the day. Any ideas? Thank you (1 Reply)
Discussion started by: n9ninchd
1 Replies

2. Shell Programming and Scripting

find 2 line numbers, grab text in between

hi, i have a large text file that I just want to extract the important information from. It will be a random number of lines but between two specific line numbers/markers. I was thinking I could get the line number for the first marker: Tablespace Percent Total Free Then get the line... (11 Replies)
Discussion started by: Da_Duck
11 Replies

3. Shell Programming and Scripting

Extracting a Number from Passage

( Database Connection Information Database server = DB2/AIX6000 8.1 SQL authorization ID = LAKNAR Local database alias = SAMPLE ROWSAFFECTED ------------ 1 1 record(s) selected. DB20000I The SQL command completed successfully. DB20000I The TERMINATE... (1 Reply)
Discussion started by: laknar
1 Replies

4. Shell Programming and Scripting

Grab from the file in one command

Dear All, I have a file in which there are 54 fields, i want to grab the all the lines and send to a new file where filed18 has lenght greater than 14. How can i do it without if condition and faster way: currently i am reading file line by line and comparing the length read fileLine... (9 Replies)
Discussion started by: bilalghazi
9 Replies

5. UNIX for Dummies Questions & Answers

Grab Portion of Output Text (sed, grep, awk?)

Alright, here's the deal. I'm running the following ruby script (output follows): >> /Users/name/bin/acweather.rb -z 54321 -o /Users/name/bin -c Clouds AND Sun 57/33 - Mostly sunny and cool I want to just grab the "57/33" portion, but that's it. I don't want any other portion of the line. I... (5 Replies)
Discussion started by: compulsiveguile
5 Replies

6. Shell Programming and Scripting

Grab 2 pieces of data within a file

I am a newbie and what I have is a captured file of content. I want to be able to grab 2 pieces of data, multiple times and print them to the screen. DataFile owner: locke user: fun data size: 60 location: Anaheim owner: david user: work data size: 80 location: Orange my script... (2 Replies)
Discussion started by: greglocke
2 Replies

7. Shell Programming and Scripting

Grab from file with sed

Hello All I have a file with this type of records: =LDR 01157nas a22003011a 4500 =001 vtls000000013 =003 VRT =005 20111020150800.0 =008 100128c19699999sp\a|||||\||||0\\\||spa| =037 \\$a1327$i090$j090$k03 =039 ... (14 Replies)
Discussion started by: ldiaz2106
14 Replies

8. Shell Programming and Scripting

Grab text after pattern and replace

i have a file which contains data seperated by comma. i want to replace text after 3rd occurrence of a comma. the input file looks like this abcdef,11/02/2015 11:55:47,1001,1234567812345678,12364,,abc abcdefg,11/02/2015 11:55:47,01,1234567812345678,123,,abc abcdefhih,11/02/2015... (4 Replies)
Discussion started by: gpk_newbie
4 Replies

9. Shell Programming and Scripting

awk remove/grab lines from file with pattern from other file

Sorry for the weird title but i have the following problem. We have several files which have between 10000 and about 500000 lines in them. From these files we want to remove lines which contain a pattern which is located in another file (around 20000 lines, all EAN codes). We also want to get... (28 Replies)
Discussion started by: SDohmen
28 Replies

10. Shell Programming and Scripting

Grab text after pattern on the same line

data: 8iW5iPACIb5fafafEU24f3EOOjpakx6VwxBX+NafafxJMWX8iW5iPACIb5fafafEU24f3EOOjpakx6VwxBX+NafafxJMWX8iW5i PACIb5fafafEU24f3EOOjpakx6VwxBX+NafafxJMWX8iW5iPACIb5fafafEU24f3EOOjpakx6VwxBX+ 8nwR15UzfeZafaf2bGr8akx6VwxBX+NafafxJMWX8iW5iPACIb5fafafEU24f3EOOjp lVpOoMLXJ ... (19 Replies)
Discussion started by: SkySmart
19 Replies
defragment(8)						      System Manager's Manual						     defragment(8)

NAME
defragment - Makes the files in a file domain more contiguous SYNOPSIS
/usr/sbin/defragment [-e] [-n] [-N threads] [-t time] [-T time] [-v] [-V] domain OPTIONS
Ignores errors and continues, if possible. Errors that are ignored are usually related to a specific file. Specifies the number of threads to run on the utility. The default number of threads that will be run is the number of volumes in the domain. The maximum number you can specify for the number of threads is 20. Prevents defragmentation from actually taking place. Use in conjunction with the -v option to display statistics on the number of extents in the file domain. Specifies a flexible time interval (in minutes) for the defragment utility to run. If the utility is performing an operation when the specified time has elapsed, the procedure continues until the operation is com- plete. Specifies an exact time interval (in minutes) for the defragment utility to run. When the specified time has elapsed, the defrag- mentation procedure stops, even if it is performing an operation. Displays statistics on the amount of fragmentation in the file domain and information on the progress of the defragment procedure. Displays the same information provided by the -v option along with informa- tion about each operation the defragment utility performs on each file. This option slows the defragment procedure. OPERANDS
Specifies the name of the file domain. DESCRIPTION
When a file consists of many discontiguous file extents, the file is fragmented on the disk. File fragmentation reduces the read/write per- formance because more I/O operations are required to access a fragmented file. The defragment utility attempts to reduce the number of file extents in a file domain by making files more contiguous. Defragmenting a file domain often makes the free space on a disk more contiguous, resulting in less fragmented file allocations in the future. Before you can defragment a file domain, all filesets in the file domain must be mounted. If you try to defragment an active file domain that includes unmounted filesets, the system displays an error message indicating that a fileset is unmounted. To determine the amount of file fragmentation in a file domain, run the defragment command with the -v and -n options. This provides the fragmentation information without starting the defragmentation process. Run defragment with the -v and -n options again to see the improve- ment. Before running the defragment utility, delete any files in the domain that you do not need. This gives the defragment utility more free space to use, which produces better results. Deleting files afterwards creates only more free-space fragments. It is also a good idea to run the balance utility on the domain before you run the defragment utility in order to balance domain free space before defragmenting the domain files. To monitor the improvement made to the file domain by the defragment utility, use the verbose mode option, -v, which displays the following information: Extents The number of extents in the specified domain. (Contiguous extents in sparse files are counted as one extent after defragmentation, when in fact there are several contiguous file extents.) Files w/ extents The number of files that have extents. (Note that files do not have extents if the files are less than 7 Kilobytes.) Avg exts per file w/ exts The average number of extents for each file that has one or more extents. Aggregate I/O perf The efficiency of the entire file domain. An increase in value indicates improvement. Free space fragments The number of free-space fragments in the domain. RESTRICTIONS
The defragment utility requires a minimum of 1 percent of the total space, or 5 megabytes per volume (whichever is less) to be free in order to run. You cannot run the defragment utility while the addvol, balance, defragment, rmfset, or rmvol utility is running on the same file domain. You must be the root user to use this utility. EXAMPLES
The following example defragments the file domain called accounts_dmn. A flexible time limit of 15 minutes is imposed and verbose mode is requested to display the fragmentation data: # defragment -v -t 15 accounts_dmn defragment: defragmenting domain 'accounts_dmn' Pass 1; Clearing Volume 1: area at block 11680 ( 103072 blocks): 81% full Domain data as of the start of this pass: Extents: 10432 Files w/extents: 4305 Avg exts per file w/exts: 2.42 Aggregate I/O perf: 52% Free space fragments: 2743 <100K <1M <10M >10M Free space: 38% 0% 0% 62% Fragments: 2742 0 0 1 Filling . . . Pass 13; Clearing Volume 1: area at block 559744 ( 62736 blocks): 0% full Volume 2: area at block 76640 ( 24624 blocks): 18% full Domain data as of the start of this pass: Extents: 4306 Files w/extents: 4305 Avg exts per file w/exts: 1.00 Aggregate I/O perf: 100% Free space fragments: 23 <100K <1M <10M >10M Free space: 0% 9% 27% 64% Fragments: 6 10 5 2 Filling Current domain data: Extents: 4305 Files w/extents: 4305 Avg exts per file w/exts: 1.00 Aggregate I/O perf: 100% Free space fragments: 17 <100K <1M <10M >10M Free space: 0% 6% 29% 65% Fragments: 3 8 4 2 defragment: defragmented domain 'accounts_dmn' The information displayed before each pass and at the conclusion of the defragmentation process shows the improvement made to the file domain by the defragment utility. SEE ALSO
Commands: addvol(8), balance(8), rmvol(8) defragment(8)
All times are GMT -4. The time now is 06:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy