I'm in an SFTP session and navigated to a deep directory. I did
ls -l, saw a small file, and want to just read it. I would prefer to do it while I'm still in SFTP, rather than starting up a new terminal, doing SSH, navigating to that deep directory, and then reading it, then going back to SFTP to continue.
Is there a way to do that?
SFTP has no
get file -, hoping it would treat
- as stdout, but that just creates a file called "-".
get file /dev/stdout, but that results in:
sftp> get file /dev/stdout Fetching /home/username/file to /dev/stdout /home/username/file 100% 506 9.0KB/s 00:00 ftruncate "/dev/stdout": Invalid argument Couldn't write to "/dev/stdout": Illegal seek
Another way might be
get file /tmp/file, come out of SFTP, read /tmp/file, delete /tmp/file, and get back into SFTP, but that's equally as tedious. Is there an easy way?