Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the Solaris equivalent to the BSD's 'tail -n100'?

I've looked this up a thousand times, and I always forget it, so, here for eternity:

Solaris has a bit of an awkward syntax for tail.

How do I do the equivalent of BSD's tail -nN?

What I want are the last N lines from tail's input.

like image 542
kch Avatar asked Nov 24 '08 14:11

kch


2 Answers

Just remove the "n"

tail -100
like image 57
Ulf Lindback Avatar answered Nov 17 '22 22:11

Ulf Lindback


Or you can use:

/usr/xpg4/bin/tail

which does behave like you want (tail -nN).

xpg4 = Xopen Portability Guide Issue 4, contains binaries strictly compliant with several POSIX and other standards. The differences with the former ones are usually details in options supported and behavior.

According to your distribution, there is also /usr/xpg6/bin, /usr/openwin/bin (OpenWindows commands), /usr/dt/bin (CDE desktop commands), /usr/sfw/bin (Solaris freeware) and various other.

For instance, Solaris Express is introducing /usr/gnu/bin to provide Gnu binaries with their custom extensions and specificities.

like image 43
VonC Avatar answered Nov 17 '22 21:11

VonC