Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add lines to end of file on Linux

Tags:

linux

shell

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?

like image 428
Antony West Avatar asked May 29 '13 20:05

Antony West


1 Answers

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 
like image 151
user897079 Avatar answered Sep 22 '22 07:09

user897079