In UNIX, how can I cat a file located in a different server?
Solution 1:
With SSH, you can connect to a remote server and use cat
remotely:
ssh remote_server cat file_name
With NFS, you can mount a remote file-system and use cat
locally:
cat /nfs_mount/file_name
Solution 2:
ssh into the server (ssh username@serverip) and then cat it?
Mount the filesystem with sshfs and cat it right from your workstation?
What exactly are you trying to achieve in catting it? Like you need to check something periodically, track something, just want to read a file that's not on your server...? Is it a system file or can you keep it in a file share of some sort? The question is kind of vague since there's a number of ways to just read a file on another system. It would help to know the circumstances and what options you have available (for example, there's no way you can simply "cat remotefile@server" in order to view it, so if you can read a file that's on a file share that you can mount or if you can secure shell into the remote system with ssh or etc. etc. would be helpful).
If you frame this as an objective there may be an alternative available. For example, if you're trying to read a remote logfile, maybe your server can be configured to send log messages to your workstation, or you can use rsync to periodically "send" your files to another workstation or email you with notifications of important messages.