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 09-01-2005, 09:22 PM   #1
austen77
LQ Newbie
 
Registered: Aug 2005
Posts: 4

Rep: Reputation: 0
Copying parts of a text file


Hi, I'm wondering what commands to use to be able to copy a certain number of lines from a text file. For instance, say i wanted to copy the first 10 lines and the last 3 lines and put them into a seperate file.

I have been able to use grep to grab lines from the start of a text file but i am stuck on how to grab them from the end of a file. Any help would be appreciated.
 
Old 09-01-2005, 09:34 PM   #2
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
Have a look at these.
man head
man tail
 
Old 09-01-2005, 09:38 PM   #3
austen77
LQ Newbie
 
Registered: Aug 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Those worked like a charm! Thanks a lot.
 
Old 09-01-2005, 09:56 PM   #4
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 59
You're welcome~
 
  


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
copying text from terminal Linuxuser_81 Linux - Newbie 4 09-30-2005 01:12 AM
Copying file in text mode? HadesThunder Linux - Newbie 5 03-30-2004 06:03 PM
Divide a file into 2 parts bmbsa Linux - Newbie 3 08-13-2003 04:08 PM
Copying Text albean Linux - Newbie 2 10-03-2002 03:58 PM
Terminal Text Copying Hitokiri_X Linux - General 4 06-18-2002 05:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:08 PM.

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