LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 04-16-2014, 09:07 AM   #1
Jeff9
Member
 
Registered: Jun 2013
Posts: 36

Rep: Reputation: Disabled
Extract the last line of files in bulk


How can I extract just the last line of files and save them to other files?

My program created many huge data files. I need to extract just the last line of each and save it to another file. That is, if I have 10 files, I need to extract the last line of each one and save them to 10 new files.

What's the easiest way to do that in Bash Linux?

Thanks.
 
Old 04-16-2014, 09:11 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 5,051

Rep: Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852Reputation: 852
man tail

maybe put it in a for loop.
 
1 members found this post helpful.
  


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
sed one line extract between two strings on one line - several occurences Jykke Linux - Desktop 2 12-05-2012 10:08 AM
bash: bulk rename files jocala Linux - General 6 09-29-2012 06:01 AM
rename bulk files scofiled83 Programming 11 06-26-2009 11:16 PM
bulk rename files atiman Linux - Newbie 5 03-05-2009 01:42 AM
Deleting files in bulk through ftp doctorwebbox Linux - Software 2 12-25-2004 01:43 PM


All times are GMT -5. The time now is 12:05 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