* copying lines from one file to another using vi
@ 2010-02-06 20:29 John Holp
2010-02-06 20:48 ` Alexander Viro
0 siblings, 1 reply; 2+ messages in thread
From: John Holp @ 2010-02-06 20:29 UTC (permalink / raw)
To: linux-audit
[-- Attachment #1.1: Type: text/plain, Size: 591 bytes --]
Redhat wizards,
I am doing good with auditing but want to copy key lines from example files into /etc/audit/audit.rules
What is the vi/vim syntax to copy lines from one file and post them into another file - i.e. my audit.rules file?
5yy appears to yank the current line and 4 more and one can paste the buffered lines into the same file but I want to pass the lines to a different file.
:h file_name I recall from along ago but that is for an entire file - I think:
Please help me to copy files from sample auditing files into my real "audit.rules".
Thanks,
John
[-- Attachment #1.2: Type: text/html, Size: 1637 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: copying lines from one file to another using vi
2010-02-06 20:29 copying lines from one file to another using vi John Holp
@ 2010-02-06 20:48 ` Alexander Viro
0 siblings, 0 replies; 2+ messages in thread
From: Alexander Viro @ 2010-02-06 20:48 UTC (permalink / raw)
To: John Holp; +Cc: linux-audit
On Sat, Feb 06, 2010 at 03:29:25PM -0500, John Holp wrote:
> Redhat wizards,
>
> I am doing good with auditing but want to copy key lines from example files into /etc/audit/audit.rules
>
> What is the vi/vim syntax to copy lines from one file and post them into another file - i.e. my audit.rules file?
>
> 5yy appears to yank the current line and 4 more and one can paste the buffered lines into the same file but I want to pass the lines to a different file.
>
> :h file_name I recall from along ago but that is for an entire file - I think:
>
> Please help me to copy files from sample auditing files into my real "audit.rules".
Switch to another file, then paste there... The most portable way is
:n <filename><CR>
but in almost all vi variants there's a way to split the window and open
a new file there. For nvi that would be
:Vi <filename><CR>
for vim - :split <filename><CR>
and switching between those subwindows is
^W
in nvi an
^Ww
in vim.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-02-06 20:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-06 20:29 copying lines from one file to another using vi John Holp
2010-02-06 20:48 ` Alexander Viro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox