3

How would I create a file in SSH with code already in it?

Something along the lines of touch filename.php >> echo "thecode here"

??

Also, any SSH tips? Looking to become more efficient.

You know, work smarter not harder.

2
  • The best ssh tip is to read the man pages for ssh and ssh_config. Commented Jun 27, 2012 at 22:27
  • Please be more specific about what you are trying to do. Commented Jun 27, 2012 at 23:26

1 Answer 1

4
echo "some text" > myfile.txt

Will result in a file named myfile.txt with "some text" in it.

If you already have a file on your local machine that you're trying to move to the remote machine, you could use scp.

scp /some/local/file.txt my.server.com:/some/remote/file.txt
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.