Putty ssh commands zip all the files in this folder and then download

oh so i cd to my folder

ls cgi-bin wp-comments-post.php wp-mail.php googlec3erferfer228fc075b.html wp-commentsrss2.php wp-pass.php index.php wp-config-sample.php wp-rdf.php license.txt wp-config.php wp-register.php php.ini wp-content wp-rss.php readme.html wp-cron.php wp-rss2.php wp-activate.php wp-feed.php wp-settings.php wp-admin wp-includes wp-signup.php wp-app.php wp-links-opml.php wp-trackback.php wp-atom.php wp-load.php xmlrpc.php wp-blog-header.php wp-login.php (uiserver):u45567318:~/wsb454434801 > 

What I want to do is zip all the files in this folder, and then download it to my computer. I am really new to ssh and this is a customers website, but I really want to start using the command line for speed, I searched a this link http://ss64.com/bash/ to find the right commands, but I really would have liked any help from anyone please?

thanks

+6
source share
6 answers
 cd path/to/folder/foldername zip -r foldername.zip foldername * [use * if it has any sub directory] 

Try this code, it will solve your problem.

+18
source

Go to the folder path using the cd command

 zip -r foldername.zip foldername 

Example: zip -r test-bkupname.zip test

Here test is the name of the folder.

+4
source

It looks like this is a webroot directory.

Why not pin the directory above (httpdocs / html / whatever) and then move it to the website space and load from there?

i.e. enter the directory above the root of the website. For example, if your web root is / var / www / html / go to / var / www / and run the following commands:

 zip -r allwebfiles.zip html mv allwebfiles.zip /html/allwebfiles.zip 

Then in your web browser go to http://mydomain.com/allwebfiles.zip and just download this file.

When extracting, you just need to extract to / var / www / OR extract in webroot and move all the files to the same level.

+2
source

If you are in the directory itself, then

 zip -r zipfilename.zip * 
+2
source
 tar zcvf ../my_directory.tar.gz . 

will create the file my_directory.tar.gz.

 scp ../my_directory.tar.gz username@your-ip :/path/to/place/file 

will transfer the file to your computer.

+1
source

Use the following ssh command to upload multiple files at a time

mget./*

0
source

Source: https://habr.com/ru/post/901901/


All Articles