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 04-16-2014, 08: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, 08:11 AM   #2
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
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 09:08 AM
bash: bulk rename files jocala Linux - General 6 09-29-2012 05:01 AM
rename bulk files scofiled83 Programming 11 06-26-2009 10:16 PM
bulk rename files atiman Linux - Newbie 5 03-05-2009 12:42 AM
Deleting files in bulk through ftp doctorwebbox Linux - Software 2 12-25-2004 12:43 PM

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

All times are GMT -5. The time now is 06:44 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
Open Source Consulting | Domain Registration