Creating a new file, editing it in an editor, and changing ownership
There are a lot of different text editors to use on a Linux system from the command line. The program vi is the Ubuntu default, and the program you will find installed on pretty much any Linux system. Emacs is another popular editor, and lots of Linux users get quite passionate about which one is better. My preference is vim, which is generally known as vi improved. The nano
text editor is another one that is commonly installed on Linux distros, and it is one of the most lightweight editors available.
Getting ready
For this recipe, we will work with vi, since that's definitely going to be installed on your system. If you want to try out vim, you can install it using this:
sudo apt-get install vim
How to do it...
- First we will go to our share directory:
 cd /home/pi/share
- Then, we will create an empty file using the
touch
command:Â touch ch3_touchfile.txt
If you use the
ls
command from the previous...