Re: tail command for Windows (466 Views)
Reply
Honored Contributor
sekar sundaram
Posts: 615
Registered: ‎11-14-2008
Message 1 of 6 (496 Views)

tail command for Windows

Good Day...

Would like to share you an idea, hope this would be helpful to you...

 

While checking System.txt file on windows nodes thru ovpdeploy, it would be better if we had a tail command similar to unix/linux. but windows never provide the unix/linux equivalent of tail command.

 

Any ideas on this - tail command equivalent on windows?!?!

HP Expert
Ramkumar Devanathan
Posts: 1,640
Registered: ‎07-31-2002
Message 2 of 6 (488 Views)

Re: tail command for Windows

Search baretail. Believe there is a free version of baretail too.
HP Software Rocks!
Honored Contributor
m_vidyasagar
Posts: 590
Registered: ‎04-21-2011
Message 3 of 6 (486 Views)

Re: tail command for Windows

Hope the below link would help you ..

 

http://www.windows-commandline.com/tail-command-for-windows/

- Vidyasagar Machani -

Tell me and I forget. Teach me and I remember. Involve me and I learn. -- Benjamin Franklin
Honored Contributor
sekar sundaram
Posts: 615
Registered: ‎11-14-2008
Message 4 of 6 (481 Views)

Re: tail command for Windows

I was looking for direct steps (without installing any new tools) for quite sometime and all google searches didnt yield good results, including stockoverflow.. (i used to think that no questions will go out of stockoverflow unanswered ;) ) but that Stockoverflow post gave me some tips. a vb script idea. but i found my own idea instead of that vb script.

 

Steps:

1. Find out the number of lines on a required logfile using windows find command.
find /c /v "" System.txt will give us the total number of lines on the given file.

 

MGMT_SVR# ovdeploy -cmd 'find /c /v "" "C:\Program Files\HP OpenView\data\log\System.txt"' -host <managed-node>

---------- C:\PROGRAM FILES\HP OPENVIEW\DATA\LOG\SYSTEM.TXT: 1539

MGMT_SVR#


2. Windows "more" command gives an idea "more +f System.txt" --- will be equivalent of tail -f System.txt

since that system.txt file got 1539 lines, i want to see last 100 lines only:

MGMT_SVR# ovdeploy -cmd 'more +1439 "C:\Program Files\HP OpenView\data\log\System.txt"' -host <managed-node>

 

 

Hope you like this one.. please let me know if arent. we will delete this post ;)

 

have a great day!!

 

Honored Contributor
sekar sundaram
Posts: 615
Registered: ‎11-14-2008
Message 5 of 6 (477 Views)

Re: tail command for Windows

Thanks Ram and Vidyasagar, will learn these ideas as well..
kudos given..

please let me know if the above idea is not good
HP Expert
Carlos_Pinto
Posts: 280
Registered: ‎06-01-2012
Message 6 of 6 (466 Views)

Re: tail command for Windows

Hello,

 

You can also use powershell example:

 

http://blogs.technet.com/b/heyscriptingguy/archive/2013/02/24/weekend-scripter-two-way-cool-powershe...

 

 

Hope this information helps.

 

Thanks and Regards,

Carlos Pinto

 

HP Support

If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.

If you liked it I would appreciate KUDOs.

The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.