Operating Systems Solaris delete first 100 lines from a file Post 302145692 by Yogesh Sawant on Thursday 15th of November 2007 02:51:05 AM
sed '1,100d' filename > newfile

sed would be faster than tail in my opinion
Test Your Knowledge in Computers #439
Difficulty: Easy
A graphics processing unit (GPU) is a specialized electronic circuit designed to rapidly manipulate and alter memory to accelerate the creation of images in a frame buffer intended for output to a display device.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

delete all lines in file

how can i delete all lines in file by using "vi" ? (6 Replies)
Discussion started by: strok
6 Replies

2. Solaris

delete first 100 lines rather than zero out of file

Hi experts, in my solaris 9 the file- /var/adm/messeages growin too first. by 24 hours 40MB. And always giving the below messages-- bash-2.05# tail -f messages Nov 9 16:35:38 ME1 last message repeated 1 time Nov 9 16:35:38 ME1 ftpd: wtmpx /var/adm/wtmpx No such file or directory Nov 9... (7 Replies)
Discussion started by: thepurple
7 Replies

3. Shell Programming and Scripting

Please help to delete lines in a file

Dear All, I m trying to delete two lines at a time in file called 123.txt. Im using sed and based on line numbers i m deleting it and writing it to another file. Follwing i have done. cat 123.txt | sed '1,5 d' > new I want to delete line no 1 and 5 at a time, for that i m using... (6 Replies)
Discussion started by: naree
6 Replies

4. UNIX for Dummies Questions & Answers

Delete same lines out of file.

hello... I have a file with a list of filepaths in it, like so: delMe.txt (files to be deleted) ./root/index.php ./root/language/se/home.inc.php ./root/language/pl/home.inc.php Now here's what I'm trying to do. I want any lines in the above file (delMe.txt) to be deleted out of the... (3 Replies)
Discussion started by: jzacsh
3 Replies

5. Shell Programming and Scripting

How to delete lines in a file that have duplicates or derive the lines that aper once

Input: a b b c d d I need: a c I know how to get this (the lines that have duplicates) : b d sort file | uniq -d But i need opossite of this. I have searched the forum and other places as well, but have found solution for everything except this variant of the problem. (3 Replies)
Discussion started by: necroman08
3 Replies

6. UNIX for Dummies Questions & Answers

How get only required lines & delete the rest of the lines in file

Hiiii I have a file which contains huge data as a.dat: PDE 1990 1 9 18 51 28.90 24.7500 95.2800 118.0 6.1 0.0 BURMA event name: 010990D time shift: 7.3000 half duration: 5.0000 latitude: 24.4200 longitude: 94.9500 depth: 129.6000 Mrr: ... (7 Replies)
Discussion started by: reva
7 Replies

7. UNIX for Advanced & Expert Users

In a huge file, Delete duplicate lines leaving unique lines

Hi All, I have a very huge file (4GB) which has duplicate lines. I want to delete duplicate lines leaving unique lines. Sort, uniq, awk '!x++' are not working as its running out of buffer space. I dont know if this works : I want to read each line of the File in a For Loop, and want to... (16 Replies)
Discussion started by: krishnix
16 Replies

8. UNIX for Advanced & Expert Users

Delete first 100 lines from a BIG File

Hi, I need a unix command to delete first n (say 100) lines from a log file. I need to delete some lines from the file without using any temporary file. I found sed -i is an useful command for this but its not supported in my environment( AIX 6.1 ). File size is approx 100MB. Thanks in... (18 Replies)
Discussion started by: unohu
18 Replies

9. Shell Programming and Scripting

Delete 40 lines after every 24 lines from a file

Hello, I have file of more than 10000 lines. I want to delete 40 lines after every 20 lines. e.g from a huge file, i want to delete line no from 34 - 74, then 94 - 134 etc and so on. Please let me know how i can do it. Best regards, (11 Replies)
Discussion started by: nehashine
11 Replies

10. UNIX for Beginners Questions & Answers

Delete Some Lines from File

Hi, I have a txt document having a format like this: DATA1 | DATA2 | DATA3 | 23-JAN-20 23:41:34 DATA1 | DATA2 | DATA3 | 23-JAN-20 23:41:32 DATA1 | DATA2 | DATA3 | 23-JAN-20 23:41:30 ... DATA1 | DATA2 | DATA3 | 23-JAN-20 22:35:31 DATA1 | DATA2 | DATA3 | 23-JAN-20 22:30:34 DATA1 | DATA2 |... (1 Reply)
Discussion started by: gc_sw
1 Replies
diffmk(1)							   User Commands							 diffmk(1)

diffmk - mark differences between versions of a troff input file SYNOPSIS
diffmk oldfile newfile markedfile DESCRIPTION
diffmk compares two versions of a file and creates a third version that includes "change mark" (.mc) commands for nroff(1) and troff(1). oldfile and newfile are the old and new versions of the file. diffmk generates markedfile, which, contains the text from newfile with troff(1) "change mark" requests (.mc) inserted where newfile differs from oldfile. When markedfile is formatted, changed or inserted text is shown by | at the right margin of each line. The position of deleted text is shown by a single *. USAGE
See largefile(5) for the description of the behavior of diffmk when encountering files greater than or equal to 2 Gbyte ( 2**31 bytes). EXAMPLES
Example 1: An example of the diffmk command. diffmk can also be used in conjunction with the proper troff requests to produce program listings with marked changes. In the following command line: example% diffmk old.c new.c marked.c ; nroff reqs marked.c | pr the file reqs contains the following troff requests: .pl 1 .ll 77 .nf .eo .nh which eliminate page breaks, adjust the line length, set no-fill mode, ignore escape characters, and turn off hyphenation, respectively. If the characters | and * are inappropriate, you might run markedfile through sed(1) to globally change them. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWdoc | +-----------------------------+-----------------------------+ SEE ALSO
diff(1), nroff(1), sed(1), troff(1), attributes(5), largefile(5) BUGS
Aesthetic considerations may dictate manual adjustment of some output. File differences involving only formatting requests may produce undesirable output, that is, replacing .sp by .sp 2 will produce a "change mark" on the preceding or following line of output. SunOS 5.10 14 Sep 1992 diffmk(1)

Featured Tech Videos

All times are GMT -4. The time now is 09:01 AM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy