BEST TAR COMMAND ( TAR ARCHIVE ) WITH EXAMPLES IN LINUX

Tar command is a very useful command utility stands for Tape Archive is also referred as Tarball is used to take backup of the data in archived format. It creates output file with extension .tar for example data.tar also called as Tar archive. Tar command is very simple to use and very convienent way to backup the data, It comes with so many features like take backup of data in archived format, compress the data by using gzip or bzip compression tools and so on.

Create a Tar Archive File using Tar Command

To create a tar archive file we can use tar command with option -c. Refer the below command.

[root@localhost ~]# tar -cvf file.txt.tar file.txt

Where :

c – create a tar archive file
v – for Verbose
f – for tar archive filename

To create a Tar archive of a directory follow the below command.

[root@localhost ~]# tar -cvf data.tar data//data/data/file3.txtdata/file2.txtdata/file4.txtdata/file1.txtdata/file5.txt

Extract a Tar Archive file using Tar Command

You can extract a tar archive file using tar command with option -x, Refer the command below.

[root@localhost ~]# tar -xvf data.tardata/data/file3.txtdata/file2.txtdata/file4.txtdata/file1.txtdata/file5.txt

Where :

x – Extract a Tar Archive

Read Full Post: http://www.elinuxbook.com/tar-command-tar-archive-with-examples-in-linux/


关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章