Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个tar包含几个文本文件的存档。我想编写一个脚本来显示(stdout)文件的内容而不将其提取到当前目录。
tar
其实我想做同样的事情:
tar tf myArchive.tar folder/someFile.txt cat folder/someFile.txt rm -R folder
但没有rm...
rm
我尝试过这种方式,但没有奏效:
tar tf myArchive.tar folder/someFile.txt | cat
谢谢
用于从存档文件x中提取。f然后还添加选项-O以将提取的文件定向到标准输出。
x
f
-O
tar xf myArchive.tar folder/someFile.txt -O