亚洲精品久久久中文字幕-亚洲精品久久片久久-亚洲精品久久青草-亚洲精品久久婷婷爱久久婷婷-亚洲精品久久午夜香蕉

您的位置:首頁技術文章
文章詳情頁

python - 管道符和ssh傳文件

瀏覽:101日期:2022-09-21 11:56:13

問題描述

看到可以用一條命令傳輸文件

gzip -c aa.txt | ssh [email protected] ' gunzip -c - > /home/bb.txt'

請問這條命令怎么理解?還有,發現對文件夾進行這樣的操作會失敗,有什么辦法傳輸文件夾么?求指教

問題解答

回答1:命令參數解釋:

gzip -h

Usage: gzip [OPTION]... [FILE]...Compress or uncompress FILEs (by default, compress FILES in-place).Mandatory arguments to long options are mandatory for short options too. -c, --stdout write on standard output, keep original files unchanged -d, --decompress decompress -f, --force force overwrite of output file and compress links -h, --helpgive this help -l, --listlist compressed file contents -L, --license display software license -n, --no-name do not save or restore the original name and time stamp -N, --namesave or restore the original name and time stamp -q, --quiet suppress all warnings -r, --recursive operate recursively on directories -S, --suffix=SUF use suffix SUF on compressed files -t, --testtest compressed file integrity -v, --verbose verbose mode -V, --version display version number -1, --fastcompress faster -9, --bestcompress better --rsyncable Make rsync-friendly archiveWith no FILE, or when FILE is -, read standard input.

gunzip -h

Usage: gzip [OPTION]... [FILE]...Compress or uncompress FILEs (by default, compress FILES in-place).Mandatory arguments to long options are mandatory for short options too. -c, --stdout write on standard output, keep original files unchanged -d, --decompress decompress -f, --force force overwrite of output file and compress links -h, --helpgive this help -l, --listlist compressed file contents -L, --license display software license -n, --no-name do not save or restore the original name and time stamp -N, --namesave or restore the original name and time stamp -q, --quiet suppress all warnings -r, --recursive operate recursively on directories -S, --suffix=SUF use suffix SUF on compressed files -t, --testtest compressed file integrity -v, --verbose verbose mode -V, --version display version number -1, --fastcompress faster -9, --bestcompress better --rsyncable Make rsync-friendly archiveWith no FILE, or when FILE is -, read standard input.Report bugs to <[email protected]>.

不知道鬧哪樣,兩條命令的幫助文檔是一樣的,開發者偷懶了

也就是說 -c 不壓縮文件,而是直接輸出到標準輸出。

gunzip -,不是從文件接收壓縮文件,而是從標準輸入接收。

|:管道>:重定向

整條命令分析

gzip -c aa.txt | ssh [email protected] 'gunzip -c - > /home/bb.txt'

gzip -c aa.txt:壓縮aa.txt文件,并將壓縮后的結果輸出到標準輸出

ssh [email protected] '命令':在遠程機器上執行命令

命令gunzip -c -:解壓文件,原壓縮文件是由標準輸入傳入的,輸出結果直接輸出到標準輸出

> /home/bb.txt:將標準輸出重定向到文件/home/bb.txt

對文件夾進行這樣的操作會失敗

gzip不支持對目錄操作

回答2:

你要么完全換用netcat來收發。要么,本地tar壓縮一下,對端解壓縮。

回答3:

管道是將前一個命令輸出作為輸入。 也可以先壓縮成一個臨時文件,再用scp

標簽: Python 編程
相關文章:
主站蜘蛛池模板: 婷婷综合社区 | 香港经典a毛片免费观看爽爽影院 | 一区二区三区在线免费观看视频 | 国产在线精品一区二区不卡 | 久久se精品一区二区国产 | 日韩欧美一区二区三区不卡在线 | 国产成人午夜性a一级毛片 国产成人午夜性视频影院 国产成人香蕉久久久久 | 精品视自拍视频在线观看 | 57pao一国产成视频永久免费 | 99成人国产精品视频 | 成年人黄色大片大全 | 那里有毛片看 | 美国人妖欧美性xxxxk妖 | 国产成人高清亚洲一区91 | 欧美黄色三级视频 | 国产一区二区在免费观看 | 丝袜美腿国产精品视频一区 | 欧美日韩国产手机在线观看视频 | 国产精品午夜国产小视频 | 国产人成精品 | 亚洲欧洲日产专区 | 91精品综合国产在线观看 | 大人和孩做爰h视频在线观看 | 成人午夜免费在线观看 | 久色国产 | 久久久精品国产免费观看同学 | 老妇xxxxbbbb| 99久久99久久精品免费看蜜桃 | 成人精品一区二区三区中文字幕 | 日韩黄色三级 | 狼人香蕉国产在线视频 | 伊人久久综合影院 | 1024cc香蕉在线观看播放中文看 | 久久婷婷午色综合夜啪 | 国产美女无遮挡免费网站 | 亚洲欧美色中文字幕 | 久久婷婷国产综合精品 | 国产精品冒白浆免费视频 | 怡红院男人天堂 | 99久久爱re热6在播放 | 图片一区|