LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-24-2006, 03:25 AM   #1
Fond_of_Opensource
Member
 
Registered: May 2006
Posts: 55

Rep: Reputation: 15
How to print a given line from a file on the standard output


How to print a given Line on standard output (Say print line No 20) from a file which contains 30 lines. Is there a single command in linux which can do this?
 
Old 08-24-2006, 03:45 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
sed -n '20p' file


Cheers,
Tink
 
  


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
can't capture 'at' command standard output to a file bartoni Linux - General 3 02-28-2006 04:52 PM
How do I forward standard and error output into same file? ivj Linux - Software 5 07-19-2005 09:30 PM
Command to output file content line by line aznluvsmc Programming 2 09-12-2004 08:45 PM
how to enumerate first line of text file to standard output? zero79 Linux - General 1 07-07-2004 07:37 PM
how do I print 'blank space' to standard out in C on same line? purpleburple Programming 7 08-19-2002 12:54 AM


All times are GMT -5. The time now is 01:02 AM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration