fetch last line no form file which is match with specific pattern by grep command
Hi
i have a file which have a pattern like this
i have written a code for fatch the line no
that will give last line no number.
For above example it gives me out put 7
but i need to match only starting 2 words only
so my output should be 6
so where i could make change to get the output 6
please Help me
thanx in advance
Last edited by Yogesh Sawant; 02-01-2011 at 06:23 AM..
Reason: added code tags
My input:
File_1:
2000_t
g1110.b1
abb.1
2001_t
g1111.b1
abb.2
abb.2
g1112.b1
abb.3
2002_t
.
.
File_2:
2000_t Ali england 135
abb.1 Zoe british 150
2001_t Ali england 305
g1111.b1 Lucy russia 126 (6 Replies)
Hi,
I have text file in the following strucher .
The files contain hondreds of lines.
value1;value2;value3;value4
I would like to get back the line with lowest date (values4 field).
In this case its line number 3.
groupa;Listener;1;20110120162018
groupb;Database;0;20110201122641... (4 Replies)
Hi all,
I have following sample input file which is a part of big file:
ID AINX_HUMAN Reviewed; 499 AA.
AC Q16352; B1AQK0; Q9BRC5;
DT 30-MAY-2000, integrated into UniProtKB/Swiss-Prot.
DT 23-JAN-2002, sequence version 2.
DT 28-NOV-2012, entry version 123.... (2 Replies)
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Hi
This is my first post and I'm just a beginner. So please be nice to me.
I have a couple of html files where a pattern beginning with "http://www.site.com" and ending with "/resource.dat" is present on every 241st line. How do I extract this to a new text file?
I have tried sed -n 241,241p... (13 Replies)
Im using the command below , but thats not the output that i want. it only prints the odd and even numbers.
awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}'
Im hoping for something like this
file1:
Text hi this is just a test
text1 text2 text3 text4 text5 text6
Text hi... (2 Replies)
Hi guys,
I am running a while loop in a script ro read a file line by line.
Now I want to run a grep only on the lines below the line I am that is being read by the while loop.
Eg:
If my while loop is on line 4 of the file, the grep only runs below line 4 and does not include line 1,2... (3 Replies)
In the below file I am trying to grep or similar, all lines where only AF= is less than 0.4.. Thank you :).
grep
grep "AF=" ,+ .4 file
file
12 112036782 . T C 34.0248 PASS ... (3 Replies)
Hi,
I have a file where versions will be updated, i need to get latest/last updated version from that file. Could you please help?
File looks like below -
<versions>
<version>R20180417.006</version>
<version>R20180421.007</version>
<version>R20180421.008</version>
... (5 Replies)
Discussion started by: schandra128
5 Replies
LEARN ABOUT OSF1
rwho
rwho(1) General Commands Manual rwho(1)NAME
rwho - Shows which users are logged into hosts on the local network.
SYNOPSIS
rwho [-a]
rwho [-a] [users]
OPTIONS
Includes all users. Without this option, users whose sessions are idle an hour or more are not included in the report.
DESCRIPTION
The rwho command displays the username, hostname, and start date and time of each session for everyone on the local network who is cur-
rently logged in to a host running the rwhod daemon.
If one or more user names are specified, only the status of those users whose names are listed appears on the screen. If a user has not
typed anything for at least 3 minutes, rwho reports the idle time as a number of minutes in the last column. After an hour of inactivity,
a user is not included unless the -a option is specified. Because this command displays a lot of output, use this command with caution if
the local network has a large number of users.
Status information is broadcast once every 3 minutes by each network host running the rwhod daemon. Any activity (such as a user logging on
or off) that takes place between broadcasts is not reflected until the next broadcast.
EXAMPLES
To get a report of all users currently logged into hosts on the local network, enter:
$ rwho
bob host2:pts5 Nov 17 06:30 :20 bob host7:console Nov 17 06:25 :25 franz
host1:pts0 Nov 17 11:20 :51 franz host1:pts8 Nov 16 15:33 :42 franz host4:console
Nov 17 16:32 pietro host1:console Nov 17 13:14 :31 pietro host1:pts7 Nov 17 13:15 :47 server
host2:console Nov 17 06:58 :20 luis host2:pts6 Nov 17 09:22
FILES
Indicates data files received from remote rwhod daemons.
SEE ALSO
Commands: ruptime(1), rwhod(8)rwho(1)