Онлайн-рабочие станции OnWorks Linux и Windows

Логотип

Бесплатный хостинг в Интернете для рабочих станций

<Предыдущая | Содержание: | Следующая>

Редактирование нескольких файлов

It's often useful to edit more than one file at a time. You might need to make changes to multiple files or you may need to copy content from one file into another. With vi we can open multiple files for editing by specifying them on the command line:



vi file1 file2 file3...

vi file1 file2 file3...


Let's exit our existing vi session and create a new file for editing. Type : Wq выйти vi, saving our modified text. Next, we'll create an additional file in our home directory that we can play with. We'll create the file by capturing some output from the ls команда:


[я @ linuxbox ~] $ ls -l / usr / bin> ls-output.txt

[я @ linuxbox ~] $ ls -l / usr / bin> ls-output.txt


Let's edit our old file and our new one with vi:


[я @ linuxbox ~] $ vi foo.txt ls-output.txt

[я @ linuxbox ~] $ vi foo.txt ls-output.txt


vi will start up and we will see the first file on the screen:


The quick brown fox jumped over the lazy dog. It was cool. Line 2

Линия 3

Линия 4

Линия 5

The quick brown fox jumped over the lazy dog. It was cool. Line 2

Линия 3

Линия 4

Линия 5


 

Лучшие облачные вычисления для ОС в OnWorks: