0

Cannot find an answer that is actually for non gui Linux to copy output of command line and paste into a config file.

The output of curl -s https://api.wordpress.org/secret-key/1.1/salt/ to setup wordpress on a server is what I'm trying to do.

Sorry if repeated, but can't find a working answer.
Thanks.

George Udosen
  • 37,534

2 Answers2

1

I assume that your conf file resides in /etc which is writable with sudo. If so, please do:

curl -s https://api.wordpress.org/secret-key/1.1/salt/ | sudo tee /etc/some_file.conf

Of course, substitute the exact name and location of your file here. If you are adding the text to the end of an existing file, use -a for 'append':

curl -s https://api.wordpress.org/secret-key/1.1/salt/ | sudo tee -a /etc/some_file.conf
chili555
  • 61,330
0

If using Putty as terminal, simply highlight the output and then open your config file. if using nano, position you cursor where you would like the content to go, and right click on the mouse.

If using gnome-terminal issue your command, use your mouse to select the output. Right click, to copy. Open your file, position the cursor, ctrl-shift-v to paste.

At the console: probably best to pipe the output to your config file: your command >> test1.txt

The >> means it will append to the end of the named file.

dajavex71
  • 474