Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm trying to setup a bash process for deploying my django project onto a linux server.

Through cygwin, I'm running a script that is calling scp to copy my files over. Is there a similar command to delete *.pyc files. As of now, I've only been able to accomplish this locally after using ssh with:

find . -name "*.pyc" -exec rm -rf {} \;

I'm looking for some kind of command to call remotely that would be equivalent.

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

You can use ssh. The format of ssh is

ssh user@host command

so something like

ssh user@host 'find . -name "*.pyc" -exec rm -rf {} \;'

You should probably use absolute paths for the remote server so you know exactly where you are deleting files. Test it out with

ssh user@host 'find . -name "*.pyc" -print'

share|improve this answer
add comment

you can sync your local to remote with rsync over ssh and have the Delete option

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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