Putty ssh 命令压缩此文件夹中的所有文件,然后下载
哦,所以我 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
请尝试这段代码,它将解决您的问题。
Please try this code, it will solve your problem.
如果您在目录本身中那么
If you are in directory itself then
使用 cd 命令转到文件夹路径
例如:zip -r test-bkupname.zip test
这里 test 是文件夹名称。
Go to folder path using cd command
Ex : zip -r test-bkupname.zip test
Here test is the folder name.
将创建 my_directory.tar.gz 文件。
会将文件传输到您的计算机。
will create my_directory.tar.gz file.
will transfer file to your computer.
看起来这是 webroot 目录。
为什么不压缩上面的目录(httpdocs / html / 等等),然后将其移动到网站空间,并从那里下载?
即进入网络根目录上方的目录。例如,如果您的 Web 根目录是 /var/www/html/,请进入 /var/www/ 并运行以下命令:
然后在 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:
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.
使用以下Ssh命令一次性下载多个文件
mget ./*
Use the following Ssh command to download multiple files at one time
mget ./*