I need to read a remote file with logs from a remote host via SSH What is the most convenient way to do it if I have ssh access to the log folder ?

link|improve this question
feedback

4 Answers

Why do anything complicated? The following should work fine..

ssh server "cat /path/to/file"

If you want paging..

ssh server "cat /path/to/file" |less

link|improve this answer
feedback

The most convenient I would say is sshfs.

link|improve this answer
feedback

Vi, nano, less, etc.

link|improve this answer
feedback

I think you should definitely use a program on the remote host and open the file there, instead of downloading the file and opening on the client side / your side.

As far as I know Linux editing/reading tools such as 'vi' or 'less' read the file line by line, therefore you don't have to open the whole log file, you just open the parts and transfer them through ssh as you read. Other operating systems have similar programs but I can't recall the name of any.

I don't know if there is a way to load the file part-by-part to a client reader on SSH though.

link|improve this answer
ssh user@server "less /path/log" sums it up – aciliketcap May 23 '10 at 13:48
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.