Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
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.
ssh
ssh_config
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
Add a comment
Required, but never shown
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.
Explore related questions
See similar questions with these tags.
sshandssh_config.