如何编辑终端中的文本文件

[英]How to edit a text file in my terminal


I'm using Linux mint and using the vi command to create text files, now that I created a text file and saved it. How do I get back into to edit the text file again?

我正在使用Linux mint并使用vi命令创建文本文件,现在我创建了一个文本文件并保存了它。如何重新编辑文本文件?

vi helloWorld.txt

3 个解决方案

#1


4  

Open the file again using vi. and then press the insert button to begin editing it.

使用vi再次打开文件。然后按插入按钮开始编辑它。

#2


19  

Try this command:

试试这个命令:

sudo gedit helloWorld.txt

it, will open up a text editor to edit your file.

它会打开一个文本编辑器来编辑你的文件。

OR

要么

sudo nano helloWorld.txt

Here, you can edit your file in the terminal window.

在这里,您可以在终端窗口中编辑文件。

#3


0  

If you are still inside the vi editor, you might be in a different mode from that you want. Hit ESC a couple of times and then "i" to enter insert mode or "a" to enter append mode.

如果您仍在vi编辑器中,则可能与您想要的模式不同。按ESC几次然后“i”进入插入模式或“a”进入追加模式。

If you are back at the command prompt, make sure you can locate the file, then navigate to that directory and perform the mentioned "vi helloWorld.txt". Once you are in the editor, you'll need to check the vi reference to know how to perform the editions you want (you may want to google "vi reference" or "vi cheat sheet").

如果您回到命令提示符,请确保您可以找到该文件,然后导航到该目录并执行上面提到的“vi helloWorld.txt”。进入编辑器后,您需要检查vi参考以了解如何执行您想要的版本(您可能想要谷歌“vi reference”或“vi cheat sheet”)。


注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2016/02/29/8fac6bbc018bd50f60b1e94c09f15f35.html



 
© 2014-2018 ITdaan.com 粤ICP备14056181号