The following image shows how to use both options with examples. That's all for this tutorial. In the next and last part of this tutorial, we will understand how to preserve SELinux contexts when extracting an archive. If you like this tutorial, please don't forget to share it with friends through your favorite social channel.
linux_18 Tar Command Examples in Linux The Linux “tar” stands for tape archive, which is used by large number ofLinux/Unixsystem administrators to deal with tape drives backup. The tar command used to rip a collection of files and directories into highly compressed archive file commonly calle...
We hope you understood the tar command. This is extremely flexible and there are a ton of options that you can play around with the command in Linux. If you want to explore more of the command options, feel free to use the -help or the man command to view the manual pages of the c...
[1].https://www.tecmint.com/18-tar-command-examples-in-linux/
--to-command=COMMAND 将提取的文件通过管道传送至另一个程序 1.4.5 文件属性操作选项 选项 说明 --atime-preserve[=METHOD] 在输出的文件上保留访问时间,要么通过在读取(默认METHOD=‘replace’)后还原时间,要不就不要在第一次(METHOD=‘system’)设置时间 --clamp-mtime 仅在文件比 --mtime 给出的时间更新...
1. 在Linux中创建 tar 存档文件 下面的示例命令将创建一个tar存档文件rumenz-14-09-12.tar对于目录/home/rumenz在当前工作目录中。请参阅示例命令的操作。 #tar-cvfrumenz-14-09-12.tar/home/rumenz/ /home/rumenz/ /home/rumenz/cleanfiles.sh ...
Examples: tar -cf archive.tar foo bar # Create archive.tar from files foo and bar. tar -tvf archive.tar # List all files in archive.tar verbosely. tar -xf archive.tar # Extract all files from archive.tar. 主操作模式: -A, --catenate, --concatenate 追加 tar 文件至归档 ...
[root@linux ~]# tar --exclude /home/dmtsai -zcvf myfile.tar.gz /home/* /etc 另外:tar命令的C参数 tar -cvf file2.tar /home/usr2/file2 tar: Removing leading'/'frommembers names home/usr2/file2 该命令可以将/home/usr2/file2文件打包到当前目录下的file2.tar中,需要注意的是:使用绝对路...
For historical reasons,taraccepts operations in various formats: UNIX short format preceded by a dash GNU long format preceded by two dashes Old style format that does not use dashes Most of our examples use the UNIX-style format. However, we’re also going to need some GNU options. ...
You can pipe the tar command into the split command.# tar cvf - /dir | split --bytes=200MB - backup.tarLet’s break down these options:-c - Create the archive -v - Verbose output -f - Name the fileIn this example, the dir/ is the directory that you want to split the backup ...