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-07-2010, 08:25 AM   #1
amv
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Rep: Reputation: 0
Question tail + option in solaris and linux


Hi All

I have a file with contents as
Line 1
Line 2
Line 3
Line 4
Line 5


In Solaris, tail command is working as
tail +1 test ---> tailing whole file
Line 1
Line 2
Line 3
Line 4
Line 5


tail +2 test --->skipping first line and tailing restLine 2
Line 3
Line 4
Line 5



But when I try the same in Linux RHEL 3.4, I am getting below

tail +1 test
tail: cannot open `+1' for reading: No such file or directory
==> test <==
Line 1
Line 2
Line 3
Line 4
Line 5


tail +2 test
tail: cannot open `+2' for reading: No such file or directory
==> test <==
Line 1
Line 2
Line 3
Line 4
Line 5




Any idea? Any alternative in LInux??

Regards
AMV
 
Old 09-07-2010, 08:33 AM   #2
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 244Reputation: 244Reputation: 244
its tail -n +2
 
Old 09-07-2010, 08:40 AM   #3
sem007
Member
 
Registered: Nov 2006
Distribution: RHEL, CentOS, Debian Lenny, Ubuntu
Posts: 638

Rep: Reputation: 111Reputation: 111
use tail -n +NUM file name

This behavior is documented in /usr/share/doc/coreutils-*/NEWS


Code:
A few usages still have behavior that depends on which POSIX standard is
  being conformed to, and portable applications should beware these
  problematic usages.  These include:

    Problematic       Standard-conforming replacement, depending on
       usage            whether you prefer the behavior of:
                      POSIX 1003.2-1992    POSIX 1003.1-2001
    sort +4           sort -k 5            sort ./+4
    tail +4           tail -n +4           tail ./+4
    tail - f          tail f               [see (*) below]
    tail -c 4         tail -c 10 ./4       tail -c4
    touch 12312359 f  touch -t 12312359 f  touch ./12312359 f
    uniq +4           uniq -s 4            uniq ./+4
 
Old 09-08-2010, 12:47 AM   #4
amv
LQ Newbie
 
Registered: Aug 2010
Posts: 5

Original Poster
Rep: Reputation: 0
Many Thanks.. Now it is clear..

Regards
AMV
 
Old 09-08-2010, 01:13 AM   #5
quanta
Member
 
Registered: Aug 2007
Location: Vietnam
Distribution: RedHat based, Debian based, Slackware, Gentoo
Posts: 724

Rep: Reputation: 100Reputation: 100
If you have similar questions at the next time, you should read the manpage to find out the answer for yourself:
Code:
-n, --lines=K
              output the last K lines, instead of the last 10; or use +K to output lines starting with the Kth
 
  


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
cpio doesn't have -P (available on solaris) option which preserve ACL's RAJCHAND094 Linux - Software 3 06-26-2008 12:50 PM
During Solaris instal no option to set hostname if network is checked? Some Guy Solaris / OpenSolaris 2 05-01-2007 01:36 AM
Solaris 10 IPFilter /etc/ipf/pfil.ap configuration option. Zepiroth Solaris / OpenSolaris 2 03-01-2007 09:54 PM
root-tail working only in rootGUI. window id option in user mode does not solve issue Emmanuel_uk Linux - Newbie 3 11-16-2005 02:04 AM
Solaris and restart option zillah Solaris / OpenSolaris 9 04-28-2005 03:02 PM


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