I am lazy to login to my server via ssh to execute just one command.

Like I need to touch /var/www/dir/file.doc. Can I do something like:

srun root@mydomain.com touch /var/www/dir/file.doc
link|improve this question

1  
Best to put the part after touch or any command in general in single quotes so client shell doesn't expand it. – Ibn Ar-Rashid May 16 '11 at 9:33
feedback

1 Answer

up vote 5 down vote accepted

Yes, you can do

ssh root@mydomain.com touch /var/www/dir/file.doc
link|improve this answer
OMG :D I didn't even try obvious solution! Thank you – fl00r May 16 '11 at 9:36
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.