Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How do you specific lines in a file? Post 81645 by blowtorch on Monday 22nd of August 2005 11:33:59 PM
Old 08-23-2005
You could use sed. I believe the syntax is as follows:
Code:
sed -n '20,40p' file_name

For files in a directory:
Code:
cd directory_where_files_are
for file_name in *; do
sed -n '20,40p' file_name
done

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Deleting specific lines in a file

I have a file which has some lines starting with a particular word. I would like to delete 5 lines before each such line containing that particular word. eg: line1 line2 line3 line4 line5 line6 "particular word"... I would like to delete line2-line6 and all such occurences in that... (4 Replies)
Discussion started by: ramu_1980
4 Replies

2. Shell Programming and Scripting

remove specific lines from a file

Hi there I have a file with a variable amount of rows but the 45th, 46th and 47th charachter of each line is the status field which is a three digit code ie 001, 002, 003 etc. My question is this..I need to strip all the records/lines with 002's out of the file completely and put them into... (14 Replies)
Discussion started by: hcclnoodles
14 Replies

3. Shell Programming and Scripting

how to remove specific lines from a file

When restoring a file in my uninstall program I need to remove the lines I added to a file during the install. In between the file can be modified by the users. Assume file1 is as follow: xxx str2 xxxx ..... ...The Following lines containing str* have to be removed... xxx str1 xxxx xxx ... (17 Replies)
Discussion started by: bluemoon1
17 Replies

4. UNIX for Dummies Questions & Answers

how to display specific lines of a specific file

are there any basic commands that can display lines 99 - 101 of the /etc/passwd file? I'm thinking use of head and tail, but I forget what numbers to use and where to put /etc/passwd in the command. (2 Replies)
Discussion started by: raidkridley
2 Replies

5. Shell Programming and Scripting

Substitute specific lines with lines from another file

Hello All, I am new to this forum. I am currently facing a problem in manipulating files. I have two files called old-matter and new-matter # cat old-matter abc: this, is a, sample, entry byi: white board, is white in color rtz: black, board is black qty: i tried, a lot asd: no... (1 Reply)
Discussion started by: rahmathulla
1 Replies

6. Shell Programming and Scripting

Cutting specific lines from a file

Hi, I have a file named Mani.txt. The contents are like this cat Mani.txt -------------------------------------------------------- Hi there how r u My Name is Mani Bye ------------------------------------------------------------ I want to cut the first and last lines from the file... (15 Replies)
Discussion started by: pathanjalireddy
15 Replies

7. Shell Programming and Scripting

Extract specific lines from a file

Hi, I have a file which contains DDL statements- CREATE TABLE, CREATE INDEX, ALTER TABLE etc. I have to only pick CREATE TABLE statements from the file- Source : ---------------------------------------------- --DDL for table abc -------------------------------------------- CREATE TABLE... (4 Replies)
Discussion started by: newb
4 Replies

8. Shell Programming and Scripting

Extracting specific lines of data from a file and related lines of data based on a grep value range?

Hi, I have one file, say file 1, that has data like below where 19900107 is the date, 19900107 12 144 129 0.7380047 19900108 12 168 129 0.3149017 19900109 12 192 129 3.2766666E-02 ... (3 Replies)
Discussion started by: Wynner
3 Replies

9. UNIX for Dummies Questions & Answers

Quick UNIX command to display specific lines in the middle of a file from/to specific word

This could be a really dummy question. I have a log text file. What unix command to extract line from specific string to another specific string. Is it something similar to?: more +/"string" file_name Thanks (4 Replies)
Discussion started by: aku
4 Replies

10. UNIX for Dummies Questions & Answers

Add strings from one file at the end of specific lines in text file

Hello All, this is my first post so I don't know if I am doing this right. I would like to append entries from a series of strings (contained in a text file) consecutively at the end of specifically labeled lines in another file. As an example: - the file that contains the values to be... (3 Replies)
Discussion started by: gus74
3 Replies
deb-old(5)							      Debian								deb-old(5)

NAME
deb-old - old style Debian binary package format SYNOPSIS
filename.deb DESCRIPTION
The .deb format is the Debian binary package file format. This manual page describes the old format, used before Debian 0.93. Please see deb(5) for details of the new format. FORMAT
The file is two lines of format information as ASCII text, followed by two concatenated gzipped ustar files. The first line is the format version number padded to 8 digits, and is 0.939000 for all old-format archives. The second line is a decimal string (without leading zeroes) giving the length of the first gzipped tarfile. Each of these lines is terminated with a single newline character. The first tarfile contains the control information, as a series of ordinary files. The file control must be present, as it contains the core control information. In some very old archives, the files in the control tarfile may optionally be in a DEBIAN subdirectory. In that case, the DEBIAN subdirec- tory will be in the control tarfile too, and the control tarfile will have only files in that directory. Optionally the control tarfile may contain an entry for `.', that is, the current directory. The second gzipped tarfile is the filesystem archive, containing pathnames relative to the root directory of the system to be installed on. The pathnames do not have leading slashes. SEE ALSO
deb(5), dpkg-deb(1), deb-control(5). Debian Project 2006-02-28 deb-old(5)
All times are GMT -4. The time now is 05:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy