4 ms·
Err, i may be missing something, but you can do this with ssh anyway: ssh host cat foo.log
by throwaway91111 9y ago
Err, i may be missing something, but you can do this with ssh anyway:
ssh host cat foo.log
- mickeyp 9y agoThen here is a better example: $ find-file /ssh:foo@example.com:/opt/myfile.txt Emacs will open the remote file in a buffer local to your Emacs and you can edit it as though it were a local file. When you save it's saved remotely, etc.
- rekado 9y agoHey mickey, thanks for "Mastering Emacs"! I'm glad I bought it. I recommend it to everyone having trouble making themselves comfortable in Emacs.
- mickeyp 9y agoThank you very much :)
- bjpbakker 9y agoCompletely agree! It came out just after I decided to ditch vim and use emacs. This book has helped me a whole lot with understanding emacs. Thank you vey much for this book Mickey!
- throwanem 9y agoSeconded - I've been using Emacs exclusively since 2009, and still find something worthwhile every time I dip into Mastering Emacs.
- gkya 9y agoAlso when you C-x C-f /ssh:x@y.com:/a/directory, it opens in dired and all the dired operations happen on the remote computer, including visiting files w/ RET. Also, from within that dired buffer, typing M-x shell RET starts a remote shell session. Dired w/ dired-hacks package is my main tool for interacting w/ projects. Also, IIRC, VC mode works nicely w/ tramp too, when editing remote files.
- oblio 9y agoI guess the SSH functionality is provided by ssh itself, or is there some SSH client built in to Emacs?
- mickeyp 9y agoEmacs uses external programs; it supports a multitude of protocols give you this transparent file access.
- auganov 9y agoEven better example, if you do say: $ *npm install whatever in a remote directory, it will actually execute the real thing on the server. So as long as you don't need to use ncurses based program etc. it's a good-enough ssh too. Though quite honestly I much prefer to just start emacs on the server, make 4 eshell windows and have it be my fancy tmux/screen. It feels inelegant when you first do it, but it's very liberating actually.
- rekado 9y agoMaybe that was a poor example. You can use SSH paths like any other local file. cp /ssh:remote.net:~/foo ~/bar cd /ssh:remote.net:~ cat /ssh:remote.net:~/foo ~/bar /ssh:somewhere.org:~/whatever You can easily write your own eshell extensions and they will automatically work for remote and local files alike.
- look_lookatme 9y agoIt's kind of hard to explain how magical working with TRAMP can feel sometimes. If you are conditioned use emacs for everything, like git or project management or file management , these things will work on a remote server as if it were local (with the only caveat being delays as it transfers data). Depending on your setup, you could reasonably dev applications running on a Digital Ocean droplet as easily as if you were editing locally.