[Linux-disciples] Editing files on a server
Stephen R Laniel
steve at laniels.org
Thu Dec 22 12:13:09 EST 2005
On Thu, Dec 22, 2005 at 12:07:48PM -0500, Jason Smith wrote:
> Ok. Based on this and Steve's email it seems safe to say I should add
> users to the file on the machine itself rather than my initial plan
> for solving this problem. How would you edit this file though if you
> were far away? Do you just run visudo remotely??
You could ssh to the remote host, then run 'sudo visudo', or
do it all in one step:
ssh -t remoteHost 'sudo visudo'
> I've given it a whirl but haven't remained sufficiently dedicated to
> it to make it through the learning curve. Do you use vim for all your
> work and general text editing?
I'm sure Adam does, and I certainly do. It has a
concision born out of an earlier era in which people did
remote work over extremely slow lines, so quite often its
succinctness is irritating. But there's apparently a more
literate way of programming it.
Even a few little vim commands make vim much much much more
efficient than any other text editor I've used -- e.g., to
select all the text from the current cursor position up to
the next repeated word (such as 'much more' earlier in this
paragraph), you can do
v/\W\(\w\+\)\W\1
which combines just three things you need to learn:
1) regular expressions (which are valuable everywhere in
UNIX)
2) the visual-select command ('v'), and
3) finding a pattern in vim ('/').
Just learn a few atoms, and you're on your way.
--
Stephen R. Laniel
steve at laniels.org
+(617) 308-5571
http://laniels.org/
PGP key: http://laniels.org/slaniel.key
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.bostoncoop.net/pipermail/linux-disciples/attachments/20051222/530ffaee/attachment.pgp
More information about the Linux-disciples
mailing list