fly*_*ire 5 powershell tar windows-10
如何.tar在Win10中从当前目录树创建一个?尝试tar -c Archive.tar *并得到tar: Failed to open '\\.\tape0'。
C:\>tar -h
tar(bsdtar): manipulate archive files
First option must be a mode specifier:
-c Create -r Add/Replace -t List -u Update -x Extract
Common Options:
-b # Use # 512-byte records per I/O block
-f <filename> Location of archive (default \\.\tape0)
-v Verbose
-w Interactive
Create: tar -c [options] [<file> | <dir> | @<archive> | -C <dir> ]
<file>, <dir> add these items to archive
-z, -j, -J, --lzma Compress archive with gzip/bzip2/xz/lzma
--format {ustar|pax|cpio|shar} Select archive format
--exclude <pattern> Skip files that match pattern
-C <dir> Change to <dir> before processing remaining files
@<archive> Add entries from <archive> to output
List: tar -t [options] [<patterns>]
<patterns> If specified, list only entries that match
Extract: tar -x [options] [<patterns>]
<patterns> If specified, extract only entries that match
-k Keep (don't overwrite) existing files
-m Don't restore modification times
-O Write entries to stdout, don't restore to disk
-p Restore permissions (including ACLs, owner, file flags)
bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.5.f-ipp
Run Code Online (Sandbox Code Playgroud)
Run Code Online (Sandbox Code Playgroud)-f <filename> Location of archive (default \\.\tape0)
您错过了-f,因此tar使用了默认位置(视为Archive.tar要存档的文件)。你的命令应该是这样的
tar -cf Archive.tar *
Run Code Online (Sandbox Code Playgroud)
虽然我不知道PowerShell的使用规则*。您可以尝试在停止解析选项--之前*通过,我希望您理解这一点。这是为了防止返回初始部分看起来像 的选项的东西。tartar*tar
| 归档时间: |
|
| 查看次数: |
17413 次 |
| 最近记录: |