Putty ssh 命令压缩此文件夹中的所有文件,然后下载

发布于 2024-12-17 04:06:46 字数 978 浏览 0 评论 0原文

哦,所以我 cd 到我的文件夹中,

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 >

我想做的是压缩此文件夹中的所有文件,然后将其下载到我的计算机上,我对 ssh 很陌生,这是一个客户网站,但真的想开始使用命令行来提高速度,我一直在寻找此参考 http://ss64.com/bash/ 来找到正确的命令,但会真的很需要有人的帮助吗?

谢谢

oh so i cd into 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 within this folder then download it to my computer i am really new to ssh and this is a clients website but really want to start to use command line for speed, i have been looking a this reference http://ss64.com/bash/ to find the right commands but would really like some help from somebody please??

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

凉世弥音 2024-12-24 04:06:46
cd path/to/folder/foldername
zip -r foldername.zip foldername *    [use * if it has any sub directory]

请尝试这段代码,它将解决您的问题。

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

Please try this code, it will solve your problem.

夏日落 2024-12-24 04:06:46

如果您在目录本身中那么

zip -r zipfilename.zip  *

If you are in directory itself then

zip -r zipfilename.zip  *
狂之美人 2024-12-24 04:06:46

使用 cd 命令转到文件夹路径

zip -r foldername.zip foldername   

例如:zip -r test-bkupname.zip test

这里 test 是文件夹名称。

Go to folder path using cd command

zip -r foldername.zip foldername   

Ex : zip -r test-bkupname.zip test

Here test is the folder name.

柳若烟 2024-12-24 04:06:46
tar zcvf ../my_directory.tar.gz .

将创建 my_directory.tar.gz 文件。

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

会将文件传输到您的计算机。

tar zcvf ../my_directory.tar.gz .

will create my_directory.tar.gz file.

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

will transfer file to your computer.

为人所爱 2024-12-24 04:06:46

看起来这是 webroot 目录。

为什么不压缩上面的目录(httpdocs / html / 等等),然后将其移动到网站空间,并从那里下载?

即进入网络根目录上方的目录。例如,如果您的 Web 根目录是 /var/www/html/,请进入 /var/www/ 并运行以下命令:

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

然后在 Web 浏览器中转到 http://mydomain.com/allwebfiles.zip 并下载该文件。

提取时,您只需提取到 /var/www/ 或提取到 webroot 并将所有文件上移一级。

Looks like this is the webroot directory.

Why not zip the directory above (httpdocs / html / whatever) and then move this into the website space, and download from there?

i.e. go into the directory above the web root. For example, if your web root is /var/www/html/ go into /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 that file.

When extracting, you'd just need to either extract into /var/www/ OR extract into webroot and move all files up one level.

还在原地等你 2024-12-24 04:06:46

使用以下Ssh命令一次性下载多个文件

mget ./*

Use the following Ssh command to download multiple files at one time

mget ./*

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文