how to tail last 500 lines and vi them?


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers how to tail last 500 lines and vi them?
# 1  
Old 11-27-2008
how to tail last 500 lines and vi them?

I have a very large log file and it speed up scrolling.
so I want to tail last 500 lies and see using vi editor.

tail -n 500 large_file | small_file | vi {};

this won't work.
I'm very novice on Unix.

TIA.
# 2  
Old 11-27-2008
Hi, do You need to edit the output? Redirect it to some tempfile and edit it,

Code:
tail -500 bigfile > /tmp/tempfile; vi /tmp/tempfile

Otherwise view it with less, like in

Code:
tail -500 bigfile | less

or view it continuously with less,

Code:
less +F bigfile

And there are more ways... Your example doesn't work because You pipe the output of tail to small_file and Your shell believes that to be a command, but I guess it isn't. I think a redirection is what You want.

/Lakris
# 3  
Old 11-27-2008
thanks a million.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Count lines and words of a stream output with tail

Hello, I need to tail -f a file output stream and I need to get only lines that contains "get" and "point" in the same line. It doesn't matter the order. Then I need only the text BEFORE "point". I have to count each line and perform other serveral actions after this has performed 3 times.... (9 Replies)
Discussion started by: Kibou
9 Replies

2. Shell Programming and Scripting

Deleting all lines except last 500

Hi All, I want to write a script which first check the line counts of a file if its more than 500 it deletes rest except the last 500.. I tried sed but it looks sed counts line numbers from the head & not from tail.. May be I need a wc -l frist then apply if statement & pass on the line count... (17 Replies)
Discussion started by: ailnilanjan
17 Replies

3. Shell Programming and Scripting

Joining multiple files tail on tail

I have 250 files that have 16 columns each - all numbered as follows stat.1000, stat.1001, stat.1002, stat.1003....stat.1250. I would like to join all 250 of them together tail by tail as follows. For example stat.1000 a b c d e f stat.1001 g h i j k l So that my output... (2 Replies)
Discussion started by: kayak
2 Replies

4. UNIX for Dummies Questions & Answers

head\tail how to display middle lines

hay i need to display middle line: 1 2 3 4 5 how can i display 3-4? (6 Replies)
Discussion started by: margan_ron
6 Replies

5. UNIX for Dummies Questions & Answers

Display lines 30 to 40 of a text file using head and/or tail commands

Assume that the text file contains over 40 lines. How do you do this?!?!? (5 Replies)
Discussion started by: phunkypants
5 Replies

6. Shell Programming and Scripting

Fill the values between -500 to 500 -awk

input -200 2.4 0 2.6 30 2.8 output -500 0 -499 0 -488 0 .......... .......... .... -200 2.4 .... ... 0 2.6 (6 Replies)
Discussion started by: quincyjones
6 Replies

7. Shell Programming and Scripting

Tail 86000 lines from 1.2 million line file?

I have a log file that is about 1.2 million lines long and about 300MB. we need a way to clean up this file and only keep the last few thousand lines. if i use tail command we run our of memory as the file is too big. I do have a key word to match on. example, we want to keep every line... (8 Replies)
Discussion started by: robsonde
8 Replies

8. Shell Programming and Scripting

To add more than 500 ips

Hi, I have a server, which has more than of 1000 ip address, but only 500 ip address are responding in the Server. Here below the error message received while restarting the named Sep 22 00:25:00 ns2 named: creating IPv4 interface eth0:595 failed; interface ignored Sep 22 00:25:00 ns2... (5 Replies)
Discussion started by: gsiva
5 Replies

9. Shell Programming and Scripting

Drop common lines at head/tail of a large set of files

Hi! I have a large set of pairs of text files (each pair in their own subdirectory) and each pair shares head/tail (a couple of first and last lines) but differs in the middle part. I need to delete the heads/tails and keep only the middle portions in which they differ. The lengths of heads/tails... (1 Reply)
Discussion started by: dobryden
1 Replies
Login or Register to Ask a Question