Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use the Tar tool to archive files under Linux

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to use Tar tools to archive files under Linux", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "how to use Tar tools to archive files under Linux" bar!

Tar is derived from Tape archiver (tape archiver) and was originally used to archive and store files on magnetic tape. Tar is a GNU software that can compress a set of files (archives) or extract them and perform related operations on existing archives. It is useful for storing, backing up, and transferring files. When creating an archive file, Tar can keep the original file and directory structure unchanged. Files archived through Tar have the suffix '.tar'.

The basic usage is as follows:

A) create an archive (c /-- create)

The code is as follows:

Tar-create-verbose-file=archive.tar file1 file2 file3

Or

The code is as follows:

Tar cvf archive.tar file1 file2 file3

Create an archive

B) list the contents of the archived file (t /-- list)

The code is as follows:

Tar-list archive.tar

List the files contained in the archive

C) extraction and archiving (x /-- extract)

The code is as follows:

Tar xvf archive.tar

Tar xvf archive.tar-- wildcards'* .c'

-extract a file with the suffix * .c from the archive.

Extract Fil

Extract only the files you need

D) Update the archived file (u /-- update)

The code is as follows:

Tar uvf archive.tar newfile.c

If the archived newfile.c is newer than the previously archived newfile.c, add the updated newfile.c to the archive.

Update an archive

E) remove files from the archive (--delete)

The code is as follows:

Tar-- delete-f archive.tar file1.c

-remove files from the archive 'archive.tar'' file1.c'

Delete a file

For more specific usage, please refer to the tar home page.

Thank you for your reading, the above is the content of "how to use Tar tools to archive files under Linux". After the study of this article, I believe you have a deeper understanding of how to use Tar tools to archive documents under Linux, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report