UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 28th, 2011, 03:20 PM
mike202 mike202 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2010
Posts: 17 mike202 New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 3 h 51 m 59 sec
Reputation Power: 0
Is there a "revese" flag in unix tail command?

hello all,
iv'e been given a homework assignment in which i should
among other things print a part of a text file backwards from the end using the unix command TAIL with some reverse flag

i searched in the man page and did not find such flag,
then googled it and found the following :

tail [+ number] [-l] [-b] [-c] [-r] [-f] [-c number | -n number] [file]

where -r is the reverse flag
but when i run "tail -r myfile.txt"
in the termial i get "tail: invalid option -- 'r' "

so is it becouse my unix is too old or somthing?
or what is going on with that ?

thanks,

and im using xubuntu 10.10 on virtual machine if it matters

Reply With Quote
  #2  
Old February 28th, 2011, 03:47 PM
ishnid's Avatar
ishnid ishnid is offline
kill 9, $$;
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Sep 2001
Location: Shanghai, An tSín
Posts: 6,894 ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level) 
Time spent in forums: 4 Months 2 Weeks 1 Day 22 h 36 m 34 sec
Reputation Power: 3885
You can pipe the output of 'tail' to the 'rev' utility.

Reply With Quote
  #3  
Old March 1st, 2011, 12:51 AM
mike202 mike202 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2010
Posts: 17 mike202 New User: is a brand new recruit and a unknown entity at this point. 
Time spent in forums: 3 h 51 m 59 sec
Reputation Power: 0
Quote:
Originally Posted by ishnid
You can pipe the output of 'tail' to the 'rev' utility.


thanks for the reply but the rev utility reverse the order of characters in every line, i need to reverse the order of the lines

something like: "tail -r -2 myfile.txt"

that will print to terminal:

"last line of file..."
"second to last line of file..."

Reply With Quote
  #4  
Old March 1st, 2011, 04:32 AM
ishnid's Avatar
ishnid ishnid is offline
kill 9, $$;
Dev Shed God 4th Plane (6500 - 6999 posts)
 
Join Date: Sep 2001
Location: Shanghai, An tSín
Posts: 6,894 ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level)ishnid User rank is General 44th Grade (Above 100000 Reputation Level) 
Time spent in forums: 4 Months 2 Weeks 1 Day 22 h 36 m 34 sec
Reputation Power: 3885
Sorry, I misread the manpage - try "tac" instead.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Is there a "revese" flag in unix tail command?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap