[Sussex] A beginner's guide to GNU/Linux

Nic James Ferrier nferrier at tapsellferrier.co.uk
Fri Dec 1 22:31:49 UTC 2006


Richie Jarvis <richie at helkit.com> writes:

> Ah-ha! Not so sir...  If you spend all your day connecting to remote 
> machines the other side of the world where your only view is an SSH 
> connection, then Gnome and KDE don't really help much... Personally, I 
> use vi - have done since day one on a unix box, its installed by default 
> (in one guise or another) on every *nix I've ever seen - I was going to 
> write that Emacs isn't, but then I realised that I don't actually know 
> whether Emacs is or not!  The amount of machines I have to be able to 
> get onto and use immediately, there is no point trying to set them all 
> up to my needs - I have to mold to theirs.

I use vi in similar circumstances... a quick edit of the shadow file
on a remote system.


But if I want to do an involved edit, cut out a rectangle and move it
about, sophistcated search and replace, something even more exotic
then I simply use emacs' tramp mode.

  C-x f /user at remotehost:/path/to/filename

opens the file in emacs (presuming you can ssh to the box).

It's even possible to do all sorts of multistepping. Once I had to ssh
to one box, sudo to another user and then ssh to another box, I can't
remember the exact syntax for this but it looks something like this:

  /multi:ssh:user at someplace:sudo:root at someplace:ssh:user at anotherplace:/pathname

This is a really powerful editing abstraction. I know vi does syntax
highlighting and stuff... but you don't always get it on a remote term
purely because of how the remote system is set up. When I use tramp to
edit a remote file I have all of *my* emacs at my disposal.

-- 
Nic Ferrier
http://www.tapsellferrier.co.uk   for all your tapsell ferrier needs




More information about the Sussex mailing list