Operating System - Linux
1825508 Members
1644 Online
109681 Solutions
New Discussion юеВ

TAR without particular extentions

 
SOLVED
Go to solution
priyarajan
Contributor

TAR without particular extentions

hi team ,

I just want to know is it possible to do a tar archive without particular extention , also let me know is it common to all Os.

Thanks
6 REPLIES 6
Ivan Ferreira
Honored Contributor
Solution

Re: TAR without particular extentions

You can use shell nesting or shell substitution, like this:


tar cvf filename `find . -type f ! -name "*.extention"`

tar cvf filename $(find . -type f ! -name "*.extention")
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Jess Long
Frequent Advisor

Re: TAR without particular extentions

If I understand the question, you want to archive a group of files, excluding those of a particular extension, right?

If so, use

tar cvf *.* exclude "*.extension"

This will archive all files except the ones with *.extension.

Hope this helps.
Peter Godron
Honored Contributor

Re: TAR without particular extentions

Hi,
yes you can create a tarfile with any name, however most people name their files #
.tar, so you can identify it as a tar file, similar to .gz extension.

Tar files are portable across platforms, as long as the tar executable is based on the the same algorithm.
Vipulinux
Respected Contributor

Re: TAR without particular extentions

Hello

Use the following command to ctreate an archieve:

tar cvf your_file output_file

Cheers
Peter Godron
Honored Contributor

Re: TAR without particular extentions

Hi,
could you please review the answers and feed back whether your problem is resolved.
priyarajan
Contributor

Re: TAR without particular extentions

Thanks Irvan ferreira

Your reply is exactly solved my problem.

Thanks alot again