: How to zip all PHP files in my webspace using SSH My hostmonster webspace account got deactivated because they found many malicious code in my files. The affected files include hundreds of PHP/JS/CSS/
My hostmonster webspace account got deactivated because they found many malicious code in my files. The affected files include hundreds of PHP/JS/CSS/ files littered around in scores of folders. It will be very time consuming to inspect all those files one by one and remove the malicious code. So I am thinking to download all the files while pertaining their path, and then hopefully on my local computer, I can remove malicious code by search and replace in NOTEPAD++. To do that, I think firstly I need to zip all the files using SSH.
I try to google the usage of zip command in SSH, but surprisingly almost all the results are very very simple, only explaining how to use zip -r to compress everything. What I need to do is to zip all PHP files, all CSS files, all JS files, etc. I also try zip -? in SSH shell, the usage is like
zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]
and in the option list, -i is include only the followin names, so I write this command
zip -i *.php PHP.zip
but it doesn't work. It returns
zip error: Invalid command arguments (nothing to select from)
I tried some other ways but none of them worked. So I have to ask it here. Any hints and directions is greatly appreciated.
More posts by @Sherry384
1 Comments
Sorted by latest first Latest Oldest Best
You need to specify the destination file prior to the condition.
zip -r PHP.zip *.php
That should work fine for you and create a zip file with all .php files from your website.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.