Unix/Linux

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • Editing a select few lines remotely

    17 answers - 953 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    Hi. Do you guys have suggestions on how I can edit just a few lines of
    a large file (a dozen or so MB) over a not-very-fast connection? The
    rest of the code is left unchanged. I was pointed to a very clumsy
    method using cat & a "split" command (forgot what it was), but it would
    be nicer if I would only need to transmit the lines I changed
    At the moment I am compressing/uncompressing at both ends because I am
    lucky that the files can be compressed well. However as I am doing it
    in Windows it is still a painWinSCP doesn't do the
    compression/decompression automatically for you (as opposed to scp -C
    user@192.168.0.2:/home/user/asdf). Actually if you guys know how any
    free file transfer client that automatically compresses the data
    streams I'd be grateful :) (btw, I tried checking the enable
    compression in the SSH option for WinSCP and it has no visible effect).
    Thanks.
  • No.1 | | 614 bytes | |

    In comp.os.linux.misc Random Penguin <nonexistent2032@yahoo.co.uk>:
    Hi. Do you guys have suggestions on how I can edit just a few lines of
    a large file (a dozen or so MB) over a not-very-fast connection? The
    rest of the code is left unchanged. I was pointed to a very clumsy
    method using cat & a "split" command (forgot what it was), but it would
    be nicer if I would only need to transmit the lines I changed

    ?

    vi filename

    use rsync/unison through ssh if you need to edit the file
    locally, but I'd just edit the file on the remote system using
    vi(m).

    []
  • No.2 | | 1045 bytes | |

    Random Penguin wrote:

    Hi. Do you guys have suggestions on how I can edit just a few lines of
    a large file (a dozen or so MB) over a not-very-fast connection? The
    rest of the code is left unchanged. I was pointed to a very clumsy
    method using cat & a "split" command (forgot what it was), but it would
    be nicer if I would only need to transmit the lines I changed

    At the moment I am compressing/uncompressing at both ends because I am
    lucky that the files can be compressed well. However as I am doing it
    in Windows it is still a painWinSCP doesn't do the
    compression/decompression automatically for you (as opposed to scp -C
    user@192.168.0.2:/home/user/asdf). Actually if you guys know how any
    free file transfer client that automatically compresses the data
    streams I'd be grateful :) (btw, I tried checking the enable
    compression in the SSH option for WinSCP and it has no visible effect).

    Thanks.

    Since you're on windows, use PuTTY to ssh into the machine and use vi
  • No.3 | | 596 bytes | |

    20 Aug 2005 14:35:14 -0700, Random Penguin
    <nonexistent2032@yahoo.co.ukwrote:
    Hi. Do you guys have suggestions on how I can edit just a few lines of
    a large file (a dozen or so MB) over a not-very-fast connection? The
    rest of the code is left unchanged. I was pointed to a very clumsy
    method using cat & a "split" command (forgot what it was), but it would
    be nicer if I would only need to transmit the lines I changed

    It would help if you can ssh to the host where the file is stored, and
    edit the file in place rather than send the file over the slow connection.
  • No.4 | | 117 bytes | |

    Thanks guys, I mistakenly thought vim download/uploaded the whole file
    like other text editors.
  • No.5 | | 338 bytes | |

    20 Aug 2005 16:17:20 -0700, Random Penguin wrote:
    Thanks guys, I mistakenly thought vim download/uploaded the whole file
    like other text editors.

    I don't think you're understanding. You run vim on the remote machine.
    All that gets transmitted is what appears in the terminal window.

    Bob T.
  • No.6 | | 413 bytes | |

    Random Penguin wrote:
    Thanks guys, I mistakenly thought vim download/uploaded the whole file
    like other text editors.

    If you SSH to the remote system, no text editor would need to
    upload/download the file, since you would actually be logged into, and
    processing on, the remote system. As someone mentioned, BTW, on Windows
    you can use Putty to connect through SSH.

    Jeff
  • No.7 | | 203 bytes | |

    K, thanks. BTW, how do I get GUI windows through SSH? I get this error
    when I try:
    WARNING: can't make an X connection to Display:
    Check DISPLAY environment variable.
  • No.8 | | 420 bytes | |

    Sat, 20 Aug 2005 17:34:52 -0700, Random Penguin wrote:

    K, thanks. BTW, how do I get GUI windows through SSH? I get this error
    when I try:

    WARNING: can't make an X connection to Display:
    Check DISPLAY environment variable.

    You don't unless you use an X Window display on your Windose box. Neither
    do you need a GUI to use vi; it is a terminal based text editor.

  • No.9 | | 452 bytes | |

    Neither do you need a GUI to use vi; it is a terminal based text editor.

    Yeah, I've already tried vi. The thing isn't with vi, it is that some
    programs like CAD tools need a GUI and I don't know how to get one
    remotely.

    Would something like VNC work over a 512/256 kbps ADSL modem? The CAD
    models are sluggish even when run locally on my home PC (AMD XP 2500+,
    1GB DDR333 RAM).

    Thanks.

  • No.10 | | 1007 bytes | |

    Random Penguin wrote:
    >>Neither do you need a GUI to use vi; it is a terminal based text editor.

    >
    >

    Yeah, I've already tried vi. The thing isn't with vi, it is that some
    programs like CAD tools need a GUI and I don't know how to get one
    remotely.

    Would something like VNC work over a 512/256 kbps ADSL modem? The CAD
    models are sluggish even when run locally on my home PC (AMD XP 2500+,
    1GB DDR333 RAM).

    Thanks.

    I would not have got your CAD requirement from your original post. VNC
    would certainly work, but would probably be painfully slow - might be
    okay for a one-time job, but would probably drive you crazy if you
    needed to do it regularly. You might try to fine-tune the description
    of what you're trying to do. Also, are you on a local Windows machine
    connecting to a remote Linux machine? Local Linux to remote Windows?
    ?

    Jeff
  • No.11 | | 2062 bytes | |

    Hiya Jeff. I am a student and am currently working from home as my
    research at this stage is mostly computational.

    My home PC is a dual boot system with Win XP and SuSE 9.2. My college
    PC runs SuSE 9.2 (64-bit). So although it is remote Linux, it can be
    either local Windows/Linux, although I prefer local Windowsthe Linux
    mouse drives me nuts*, my Sapphire Radeon 9800 Pro isn't recognised
    (yes I've tried fixing both) and messes up spreadsheets.
    I'll give a proper shot at sorting these problems out when I do get
    some holidays

    Now, as for a description of my workI need to edit some long input
    files, which is fed into a finite element analysis program. This is
    where the text editor comes in. I've played around with vim and maybe
    it is just my inexperience showing, but the copy & paste which is
    essential to my text editing (because the input files are *very* picky
    about formats - press Num Lock or Tab and the program crashes). Can vim
    copy & paste with a Ctrl-C analogue? I find that the two mouse buttons
    simultaneously is a bit clumsy and as I said, the input formatting must
    be *exact*.

    the text editing is complete, I run the finite element analysis.
    When it is done, I need to use a GUI package (only in Linux) to inspect
    the results. At the moment I do this by downloading the files,
    rebooting to Linux at home and checking it. I'd love to do this
    remotely.

    As a guideline, a 10 frame/second animation of it in .gif format is
    already several megabytes.

    *Really, the Linux mouse almost gives me a sense of claustrophobia.
    When I play FPS games I have the sensitivity at about 15 and manage
    headshots just fine, I'm that much of a "hyper" person. The Windows
    mouse speed on max is barely tolerable for me as well. From what I've
    read, quite a few of people complain about the Linux mouse, but I've
    seen the same max speeds in all the distros I've tested.

    Thanks Jeff.

  • No.12 | | 994 bytes | |

    2005-08-21, Random Penguin <nonexistent2032@yahoo.co.ukwrote:

    Can vim
    copy & paste with a Ctrl-C analogue?

    Well, it can copy and paste, but it's not with ctrl-c. Run the vimtutor
    program (if your vi is vim) to learn how to use vi. Until then, you
    may be more comfortable with an editor like joe, nano, or pico.

    the text editing is complete, I run the finite element analysis.
    When it is done, I need to use a GUI package (only in Linux) to inspect
    the results. At the moment I do this by downloading the files,
    rebooting to Linux at home and checking it. I'd love to do this
    remotely.

    Assuming the program is on your lab linux machine, you need an X server
    at home and an ssh client that does X11 tunnelling. Google will turn up
    many relevant web pages which describe how to do this for your home
    computer's S. If it's linux, and Google isn't helpful, you can post
    back here with more specific questions.
  • No.13 | | 1651 bytes | |

    In comp.os.linux.misc Keith Keller <kkeller-usenet@wombat.san-francisco.ca.us>:
    2005-08-21, Random Penguin <nonexistent2032@yahoo.co.ukwrote:
    >>

    >Can vim
    >copy & paste with a Ctrl-C analogue?


    Well, it can copy and paste, but it's not with ctrl-c. Run the vimtutor
    program (if your vi is vim) to learn how to use vi. Until then, you
    may be more comfortable with an editor like joe, nano, or pico.

    Excellent advice. Curious how people put down stuff they don't
    have any clue about, one of if not the most powerful editor at
    all and people ask about this "Affengriff".;(

    Somehow like comparing abetter (doze editor) with Michael
    Schumacher's Ferrari (vim). ;-)

    >the text editing is complete, I run the finite element analysis.
    >When it is done, I need to use a GUI package (only in Linux) to inspect
    >the results. At the moment I do this by downloading the files,
    >rebooting to Linux at home and checking it. I'd love to do this
    >remotely.


    Assuming the program is on your lab linux machine, you need an X server
    at home and an ssh client that does X11 tunnelling. Google will turn up
    many relevant web pages which describe how to do this for your home
    computer's S. If it's linux, and Google isn't helpful, you can post
    back here with more specific questions.

    The most powerful, even over slow connections, actually it even
    beats the crap out of citrix, is called "nomachine" and just
    needs port 22 (ssh).
  • No.14 | | 499 bytes | |

    Sun, 21 Aug 2005 07:52:12 +0200, Michael Heiming wrote:

    Excellent advice. Curious how people put down stuff they don't
    have any clue about, one of if not the most powerful editor at
    all and people ask about this "Affengriff".;(

    Full ack.

    Somehow like comparing abetter (doze editor) with Michael
    Schumacher's Ferrari (vim). ;-)

    You would not have made that comparison if you had seen today's qualifying
    laps at Istanbul :-))

  • No.15 | | 518 bytes | |

    In comp.os.linux.misc Dave Uhring <daveuhring@yahoo.com>:
    Sun, 21 Aug 2005 07:52:12 +0200, Michael Heiming wrote:
    []

    >Somehow like comparing abetter (doze editor) with Michael
    >Schumacher's Ferrari (vim). ;-)


    You would not have made that comparison if you had seen today's qualifying
    laps at Istanbul :-))

    Have no TV, but like the simplicity of drawing comparisons with
    cars, no matter how bad his luck was during todays qualifying.;)
  • No.16 | | 380 bytes | |

    Random Penguin wrote:

    Hiya Jeff. I am a student and am currently working from home as my
    research at this stage is mostly computational.
    snip

    I suggest that people make a practice of not responding to these
    context free messages from google other than to advise how to use
    the system correctly. See sig below. This may serve to stamp out
    this plague.
  • No.17 | | 321 bytes | |

    20 Aug 2005 21:06:32 -0700, Random Penguin
    <nonexistent2032@yahoo.co.ukwrote:
    I find that the two mouse buttons simultaneously is a bit clumsy and
    as I said, the input formatting must be *exact*.

    Get a three button mouse, or one with a wheel (when you press the wheel,
    it acts as the third button).

Re: Editing a select few lines remotely


max 4000 letters.
Your nickname that display:
In order to stop the spam: 0 + 9 =
QUESTION ON "Unix/Linux"

EMSDN.COM