cheat:ed --- tags: [ ed ] --- # File and buffer management :e {file} load file to buffer :q quit :Q quit without saving changes :f {name} change buffer name :w write to file using current buffer name :w {file} write buffer to new file :wq write buffer to existing file and exit # Line-oriented addressing and movement # `ed' uses line addresses to move around and operate within a buffer # Move to or operate on single lines by entering the line number # Move to or operate on ranges of lines using comma-separated values # The active line is always set to the last number of the range entered . or p display current line n display current line with line number 1,$ or , range indicating the entire buffer; displays final line 3 or 3p move to line 3 of the buffer and display 3n move to line 3 of the buffer and display with line number 1,$p or ,p display entire buffer without line numbers 1,$n or ,n display entire