Hi all,
I have a file with lines written somewhat like this.
aaaa
ccc
aa
linux
browse = no
xssxw
cdcedc
dcsdcd
csdw
police
dwed
dwd
browse = no
cdecec (2 Replies)
How do I replace only if the keyword is at the begining of a line?
Code:
--
a = “This is a print statement”
print a
--
What if I want to replace print by #print only in the second line i.e only if the line starts with that keyword.
Please help me out. I'm new to SED.
-----Post... (5 Replies)
hi dudes;
this is my file.txt:20101228-180436_Down
a 1
b 2
...
20101228-190436_Rollback
a 1 40
e 3 20
...
20101228-180436_Down
c 2
f 2
c 1
...
and i have a down.txt:a 1 aa 2 30 bb 1 40
b 2 ab 3 10
c 3 cd 4 50 ac 2 20
c 3 ad 1 0 (2 Replies)
I have a file that has the words I want to find in other files (but lets say I just want to find my words in a single file). Those words are IDs, so if my word is ZZZ4, outputs like aaZZZ4, ZZZ4bb, aaZZZ4bb, ZZ4, ZZZ, ZyZ4, ZZZ4.8 (or anything like that) WON'T BE USEFUL.
I need the whole word... (6 Replies)
Hi friends,
i just want to know the command though which i can get the next word which comes just after a particluar keyword. For example:
suppose text.out is file which contains a pl/sql procedure . i want to find out the word which falls just after the "table1" keyword.
Thank... (7 Replies)
How to catch a two word keyword which may contain a new line(may include spaces or tab) in it.
for example there is a file a.txt.
$more a.txt
create view
as
(select from
.........
..........
( select
....
(
select
......
..
select only no (((
number
( select
end (12 Replies)
Hi
I want to implement something like this:
if( keyword1 exists)
then
check if(keyword2 exists in the same line)
then replace keyword 2 with New_Keyword
else
Add New_Keyword at the end of line
end if
eg:
Check for Keyword JUNGLE and add/replace... (7 Replies)
Hi Everyone,
Need help in extracting the hostname from the below output.
Expected output:
DS-TESTB-GDS-1.TEST.ABC.COM
DS-TESTB-GDS-2.TEST.ABC.COM
....
...
/tmp $ cat -n /tmp/patchreport
1 /usr/bin/perl /admin/bin/patch/applyPatches.pl --apply_patches... (4 Replies)
I have a file where every line includes four expressions with a caret in the middle (plus some other "words" or fields, always separated by spaces). I would like to extract from this file, all those lines such that each of the four expressions containing a caret appears in at least four different... (9 Replies)
I have a csv file as shown below,
xop_thy 80 avr_njk 50 str_nyu 60
avr_irt 70 str_nhj 60 avr_ngt 50
str_tgt 80 xop_nmg 50 xop_nth 40
cyv_gty 40 cop_thl 40 vir_tyk 80
vir_plo 20 vir_thk 40 ijk_yuc 70
cop_thy 70 ijk_yuc 80 irt_hgt 80
I need to align/sort the csv file based... (7 Replies)
Discussion started by: dineshkumarsrk
7 Replies
LEARN ABOUT DEBIAN
flow-filter
flow-filter(1) General Commands Manual flow-filter(1)NAME
flow-filter -- Filter flows.
SYNOPSIS
flow-filter [-hko] [-a src_as_filter] [-A dst_as_filter] [-b big|little] [-C comment] [-D dstaddr_filter_name] [-d debug_level] [-e
exaddr_filter] [-f acl_fname] [-i input_filter] [-I output_filter] [-p srcport_filter] [-P dstport_filter] [-r ipprot_filter] [-S
srcaddr_filter_name] [-t tos_filter] [-T tcp_flags_filter] [-x nexthop_filter_name] [-z z_level]
DESCRIPTION
The flow-filter utility will filter flows based on user selectable criteria. The IP address filters are defined in flow.acl or by the
filename specified by -f.
Other filters such as input interface and ports are defined on the command line. These filters accept range and negation operators, ie
-i1-15 for input interfaces 1 through 15 or -i1,15 for input interfaces 1 and 15, or !1,15 for not input interfaces 1 and 15.
The syntax is kludgy and needs reworked but works for most applications.
OPTIONS -a src_as_filter
Source AS filter, ie -a159 to permit Autonomous System 159.
-A dst_as_filter
Destination AS filter, ie -A159,3112 to permit Autonomous Systems 159 and 3112.
-b big|little
Byte order of output.
-C Comment
Add a comment.
-d debug_level
Enable debugging.
-D dstaddr_filter_name
Destination IP address filter. This is the name or number of a standard access list defined in flow.acl or the file specified by
-f.
-e exaddr_filter
Exporter IP address filter. One exporter address can be filtered.
-f acl_fname
Access list filename. Defaults to flow.acl.
-h Display help.
-i input_filter
Input interface filter, ie -i0 to permit traffic from interface 0.
-k Keep time from input.
-I output_filter
Output interface filter, ie -I0 to permit traffic to interface 0.
-o Logical OR instead of AND filters.
-p srcport_filter
Source port filter, ie -p80 to only permit source port 80.
-P dstport_filter
Destination port filter, ie -P80,8080 to permit destination ports 80 and 8080.
-r ipprot_filter
IP Protocol filter, ie -r6 to only permit TCP traffic.
-S srcaddr_filter_name
Source IP address filter. This is the name or number of a standard access list defined in flow.acl or the file specified by -f.
-t tos_filter
ToS bits filter. An optional mask is available which is applied to the tos field before comparing to the filter list. For exam-
ple to match a tos bit pattern of 101xxxxx use 0xA0/0xE0.
-T tcp_flags_filter
TCP bits filter. An optional mask is available which is applied to the TCP flags field before comparing to the filter list. For
example to match a flows with the SYN bit set use 0x2/0x2.
-x nexthop_filter_name
NextHop IP address filter. This is the name or number of a standard access list defined in flow.acl or the file specified by -f.
-z z_level
Configure compression level to z_level. 0 is disabled (no compression), 9 is highest compression.
EXAMPLES
Print all traffic with a destination port of 80.
flow-cat /flows/krc4 | flow-filter -P80 | flow-print
Print all traffic with with source IP 10.0.0.1. Populate flow.acl with
ip access-list standard badguy permit host 10.0.0.1
flow-cat /flows/krc4 | flow-filter -Sbadguy | flow-print
Report all destinations that IP 10.0.0.1 has sent traffic to. Sort by octets. Populate flow.acl with
ip access-list standard badguy permit host 10.0.0.1
flow-cat /flows/krc4 | flow-filter -Sbadguy | flow-stat -f8 -S2
BUGS
Extended access lists are not fully implemented. The command line filter syntax is a kludge.
NOTES
Use flow-nfilter.
AUTHOR
Mark Fullmer maf@splintered.net
SEE ALSO flow-tools(1)flow-filter(1)