Ubuntu – How to append multiple lines of text to a file

command linetext;

I want to append this text:

<Directory "/var/www/*">
    Order allow,deny
    Allow from all
    AllowOverride All

to the file /etc/apache2/apache2.conf

I have access via SSH but I don't know how to use VIM. I would like to do this via a command.

Best Answer


nano /etc/apache2/apache2.conf

(you may need to use sudo)

This will give you a command line text editor that works much like normal text editors. Use the arrow keys to navigate. Backspace, enter, etc. work as normal.

To save, press Ctrl+O and use Ctrl+X to exit. For help, press Ctrl+G from inside nano, or use man nano.

It should look something like this: