Antony West
Antony West

Reputation: 1497

How to add lines to end of file on Linux

I want to add the following 2 lines:

VNCSERVERS="1:root"
VNCSERVERARGS[1]="-geometry 1600x1200"

to the end of the file vncservers found at the directory /etc/sysconfig/.

How can I do this?

Upvotes: 144

Views: 233458

Answers (1)

user897079
user897079

Reputation: 2945

The easiest way is to redirect the output of the echo by >>:

echo 'VNCSERVERS="1:root"' >> /etc/sysconfig/configfile
echo 'VNCSERVERARGS[1]="-geometry 1600x1200"' >> /etc/sysconfig/configfile

Upvotes: 271

Related Questions