SSH replace string example [closed] - ssh

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I need to replace multiple (150+) config.php files on live server that contain string
public_html/home2/cpaneluser
to
public_html/home/cpaneluser
can someone give me an example of SSH string replace please.
if you can give me an example of replacing ONE and replacing multiple please .
thank you!

Use sed. This has not specific to ssh, which is just a way to login to a remote server.
sed -i.bak 's|public_html/home2/cpaneluser|public_html/home/cpaneluser|' file1 file2 ...
You say there are 150+ files. You can use find to find them and pass them to the command:
find <topdir> -name config.php -exec sed -i.bak 's|public_html/home2/cpaneluser|public_html/home/cpaneluser|' {} +

Related

Is there a way to scp copy a .tar.gz file from a remote server using ssh command? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 3 years ago.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Improve this question
I'm trying to copy a .tar.gz file from a remote server onto my machine. I have used the scp method successfully before on different file types but having issues using the same method with a .tar.gz file. What do I need to do differently?
The command I've tried is below..
scp userlogin#remoteserver:/ remote/file/path/.tar.gz local/file/path/to/copy/into
I get that there is 'no such file or directory' - i suspect this may be something to do with how the tar.gz file is compressed? Is it not picking it up?
The source location in your scp command is malformed, try
scp userlogin#remoteserver:/remote/file/path/.tar.gz local/file/path/to/copy/into

run bash (command line) inside Emacs text editor? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
i want to run command line inside emacs text editor .
i have just finished the emacs tutorial i want to practice in some SQL files and i need the command line near to me to see SQL changes and results
any idea ?
There you have some tips how to or basicaly run 2 terminals on one Computer(Subshells)
or GNU documentation website of emacs with some valuable links for shells

How to view a file on PuTTY? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I opened a file in PuTTY and I need the file .flag, how do I open it?
I have tried
vi index.flag
and
cp index.flag
To list all files in a directory with their permissions run
ls -la
Make sure your user have at least read permission on the file you need to open
open the file using vi editor (assuming the file you want to open is called .flag)
vi .flag
you can also use the cat command to just to view the contents of a file
cat .flag

How to stop the individual programs that are specified in supervisord.conf file? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
I want to manage few process using supervisor.I have made the changes in the supervisord.conf file.I want to stop a few programs later
I tried using "supervisorctl stop program_name" command but I get the following
Sorry, supervisord responded but did not recognize the supervisor namespace commands that supervisorctl uses to control it. Please check that the [rpcinterface:supervisor] section is enabled in the configuration file (see sample.conf).
Can somebody guide me?
Thanks in advance
Add this to your /etc/supervisord.conf:
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
And restart supervisord:
sudo /etc/init.d/supervisord restart

Google Code Jam Answer Submiting [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
This time i'm going to participate in Google CodeJam for the first time.. I don't know how to submit a output and i cant understand the guidelines please help me.
I tried to upload a text file containing the answers for small input but it won't accept
You can ask for assistance from the CodeJam administrators. Post your query on the CodeJam forum they can guide you well. Plus the response time is also pretty good.
Secondly you mentioned that your text file was not accepted. In that case, what was the error?
I know, it is late, but for the next codejam and other coding competitions -
If you are using bash, then run this on terminal, [assuming the input file has name input.in and your code reads everything from stdin and prints everything on stdout]
./myCode < input.in > output.out
and then upload the output.out file.
** For more details, search for I/O redirection on bash.