惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
L
Lohrmann on Cybersecurity
aimingoo的专栏
aimingoo的专栏
V
V2EX
S
Security Affairs
T
Threatpost
C
CXSECURITY Database RSS Feed - CXSecurity.com
IT之家
IT之家
J
Java Code Geeks
The Register - Security
The Register - Security
U
Unit 42
C
CERT Recently Published Vulnerability Notes
月光博客
月光博客
A
About on SuperTechFans
H
Hackread – Cybersecurity News, Data Breaches, AI and More
T
The Blog of Author Tim Ferriss
Cisco Talos Blog
Cisco Talos Blog
Project Zero
Project Zero
S
Schneier on Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
D
DataBreaches.Net
博客园 - 司徒正美
V
Vulnerabilities – Threatpost
T
Tor Project blog
Security Latest
Security Latest
T
The Exploit Database - CXSecurity.com
T
Threat Research - Cisco Blogs
Scott Helme
Scott Helme
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
M
MIT News - Artificial intelligence
云风的 BLOG
云风的 BLOG
小众软件
小众软件
L
LangChain Blog
Attack and Defense Labs
Attack and Defense Labs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
P
Palo Alto Networks Blog
A
Arctic Wolf
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Cyber Attacks, Cyber Crime and Cyber Security
博客园 - 叶小钗
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
LINUX DO - 最新话题
MongoDB | Blog
MongoDB | Blog
Webroot Blog
Webroot Blog
H
Hacker News: Front Page
Know Your Adversary
Know Your Adversary
Spread Privacy
Spread Privacy
AWS News Blog
AWS News Blog
Engineering at Meta
Engineering at Meta

Bash

Linux bash 脚本监控和重启一个守护进程 - V2EX 有个脚本代码的问题 Bash Script 代码比较,你认为哪个更加容易理解? 有使用 kitty 当日常终端的老哥吗? - V2EX 在输入命令时,自动调用 fzf 进行模糊匹配 使用 shell 的 bash -c "functions"时,是不是所有相关的函数都得声明出来? shell 比较浮点数大小的问题,顺便吐槽以下 shell - V2EX bash-completor:声明式编写 Bash 补全脚本 - V2EX sudo 改用 pkexec 的问题 - V2EX sed 如何查找替换反斜杠 - V2EX lobash 发布 v0.5.0 版本 - V2EX 为什么这样写无法连接(join)数组各项? - V2EX 如何使用 awk 打印 nginx 404 日志的目录 - V2EX 请教一下,怎么把向终端输入的内容重定向一份到文件? - V2EX 请教一下 shell 里使用 jq 处理 json 应该怎么写 - V2EX 求一个 wsl2 ubuntu20.04 的默认 /etc/bash.bashrc - V2EX 如何让 bash 的补全 popup 显示 - V2EX 如何去除 Bash variable expansion 后加的单引号? - V2EX 初学者写了个 bash 脚本,求大佬点评 - V2EX 如何获取命令标准输出到变量里并保留颜色?或者能不能一边输出一边赋值或判断。 - V2EX 请问如何在 alias 命令里传递参数? - V2EX Bash 下如何优雅地临时在后台运行程序并易于管理? - V2EX shell tr -cd 匹配字符串问题 - V2EX shell 中的 import 能不能支持 as 或 alias 类似功能 - V2EX Shell 多个文本间隔追加的方法 - V2EX 生产服务器集群被黑了,帮看看这个脚本 - V2EX 如何实现一个符合规范的 shell? - V2EX 请教下如何检测文件是否存在 - V2EX bash 里面有 io 多路复用吗? - V2EX 闲的蛋疼,用 shell 写了个拓扑排序。。。 - V2EX echo '1 2'|awk "{print $2}"的输出为什么是 1 2 - V2EX Shell 中冒号变成了斜线 - V2EX 大家觉得 shell 如何呢? - V2EX 如何让 ls 默认带--group-directories-first 选项 - V2EX shell 脚本用 expect 输入密码,密码带有{}导致 expect 报错 - V2EX 询问一个正则表达式,请大家帮忙 - V2EX 请教一个 bash 的问题 - V2EX 请教 Shell 空字符串数组的问题 - V2EX 统计一下,如果你在用 bash,用什么版本号的 bash? - V2EX sh 可以运行后执行一段脚本吗? bash 是可以的。 - V2EX bash shell history search - V2EX Shell 给变量的赋值里带 $ 要怎么写? - V2EX [求助] shell 处理 yaml - V2EX 今天想合并文件写出个递归。。。 - V2EX 啊,我中毒了 - V2EX 寻一段 shell 来实现自动填写 ssh 登录密码 - V2EX 秀一下原生的 “终端.app”(bash) - V2EX # [求助] 用 curl 抓取一个网站,网站有很多分页,但不论怎么指 page=[2-100],抓取的都只是 page=1 的内容... - V2EX 请问这段 shell 代码有设么问题吗 - V2EX
tar 使用管道的困惑 - V2EX
xltfes · 2021-03-04 · via Bash

这是一个创建于 1928 天前的主题,其中的信息可能已经有所发展或是发生改变。

这个网页上看到(cd backup && tar c .) | (cd backupArchives && tar xf -)这条命令,对于 tar 直接用管道进行打包解包这个操作直呼少见,man tar中也没看到相关介绍

  • 用-表示标准输入这种操作是哪来的?希望大佬解惑
  • 如果能给出 unix-style 或 gnu-style 的标准写法就更好了\doge
codehz

1

codehz      2021 年 3 月 4 日 via Android

(就是约定俗称,最初的原因就是这玩意天然不适合做文件名,刚好可以用来表达标准输入输出(
按标准写法的话是直接用-O 表示标准输出,不写文件名就是标准输入(

polaa

2

polaa      2021 年 3 月 4 日

man tar 里有
-f file, --file file
Read the archive from or write the archive to the specified file. The
filename can be - for standard input or standard output. The default
varies by system; on FreeBSD, the default is /dev/sa0; on Linux, the
default is /dev/st0.

billlee

3

billlee      2021 年 3 月 4 日

GNU tar 这里也可以不指定 f 选项,没有 f 时就是读标准输入

GNU cp 可以用 cp -rT backup backupArchives 来达到同样目的

但 POSIX 里面 tar 不指定 f 时的输入是不确定的. POSIX cp 也没有 -T 这个选项,所以那个网页才给了个这么绕的命令吧

Usaki

6

Usaki      2021 年 3 月 5 日 via Android

最近用 pigz 和 tar 也遇到这个-了,不加还报错

xltfes

7

xltfes      2021 年 3 月 5 日

@polaa 手册居然还有不一样的,用的 tar 不一样么?
tar --version
tar (GNU tar) 1.29
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.

polaa

8

polaa      2021 年 3 月 5 日

@xltfes macOS 上的 man tar 里的 ,应该是 BSD 的 manual 不算 GNU 的

julyclyde

9

julyclyde      2021 年 3 月 7 日

man tar 不介绍是因为这事和 tar 根本没关系
只是把管道当作文件操作而已