LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 12-31-2003, 10:35 AM   #1
mikeshn
Member
 
Registered: Feb 2002
Distribution: Fedora Core 2
Posts: 586

Rep: Reputation: 30
cat: output specific number of lines


Can cat command output specific number of lines? Example, output lines from 1 to 10 .
 
Old 12-31-2003, 10:58 AM   #2
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Try using head:
head -10 /path/to/file
 
Old 12-31-2003, 11:02 AM   #3
mikeshn
Member
 
Registered: Feb 2002
Distribution: Fedora Core 2
Posts: 586

Original Poster
Rep: Reputation: 30
Quote:
Originally posted by stickman
Try using head:
head -10 /path/to/file
Is it possible to output from position 10 to 30 ?
With two parameters ?
 
Old 12-31-2003, 12:15 PM   #4
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 50
head -30 /path/to/file | tail -20

print the last 20 of the first 30 lines ie 10-30
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading the number of Lines in a File Mistro116@yahoo.com Programming 31 11-24-2005 12:36 AM
output number of blank lines tjgadu Linux - Newbie 7 06-09-2005 04:01 PM
Cat input output error zaicheke Slackware 15 12-26-2004 09:08 PM
output to a file - cat? grep? Godsmacker777 Linux - Newbie 6 12-08-2004 10:06 AM
replacing specific lines in a text document stellarmarine1 Linux - General 1 09-07-2004 02:34 PM


All times are GMT -5. The time now is 03:27 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration