Log In | Register | May 20, 2013

Share
 

Linux - June 16, 2012

Create and edit text files.

There are many ways in creating and even editing files in Linux. You can use commands such as vim and touch to create and edit files.

An easy way to create a new file is by using the touch command as such.

touch new_file.txt

The above command will create a empty file if the file does not exist or if it does it exist it will just update the timestamp on that file.

To edit the new file you can now use the program vim or vi. Usually you’ll see that the vi command is just a symlink or alias to the actual command vim, which stands for vi improved.

For instance to edit the new_file.txt you would use the following command.

vi new_file.txt

In order to use vim, you need to be familiar with the various modes such as Command, Insert, and Visual. Each mode allows you to modify the file in various ways. To learn more on how to use vim, from a terminal run the vimtutor command as such.

vimtutor

After running the command you will be brought to a tutorial going through everything you need to know in order to use vim efficiently as an editor.

Post By: | FavoriteLoadingAdd to favorites

1 Comments

RHCSA Certification Study Guide | DevBlog.co
Monday, June 25, 2012

[...] Create and edit text files [...]

Leave a Comment



Need Help? Ask a Question

Ask anything you want from how to questions to debug. We're here to help.

You Must Be Logged In To Post A Question.

Log In or Register