List contents of file on remote server

Scot L. Harris webid at cfl.rr.com
Fri Sep 17 02:14:56 UTC 2004


On Thu, 2004-09-16 at 21:32, Ben Halicki wrote:
> Hi all,
>  
> Anyone know a quick and easy way to list the contents of a file on a
> remote machine?  Similar to the cat command, but the file is sitting
> on another server.  I was thinking about using scp to copy the file to
> the local machine first, then using cat, but thought there might be a
> way of performing this in one step?
>  
> Thanks in advance,
>  
How about this:

ssh computernameorIP 'cat /etc/hosts'

Replace compternameorIP with the name of the machine you want to
access.  You can execute what ever you want in the command portion, in
this case I just cat'ed the /etc/hosts file on the remote machine.

-- 
Scot L. Harris
webid at cfl.rr.com

Usage: fortune -P [-f] -a [xsz] Q: file [rKe9] -v6[+] file1 ... 





More information about the fedora-list mailing list