How do I work with multiple files at the same time?


vi allows for multiple files to be open at the same time. Unlike many editors, you only see one file at a time. If you start vi with multiple files on the command line they'll all be opened up.
You'll start out in the first file, and you can move to the next file by typing :n.
If you've made changes to the current file that you don't want to keep, you can go on by using :n!. Note that this will discard any changes that you've made.
If you want to save, you need to use :w first.

 

Posted by 옥탑방람보
,