When a new archive is created by tar command, the archive includes a same name file of itself

Solution Verified - Updated -

Issue

  • When a new archive with the current directory is created on the current directory by using tar command, the archive includes a same name file of itself.
 # ll
 total 8
 -rw-r--r-- 1 root root 185 Jun 25 13:57 hosts  (sample file)

 # tar czf AAA.tar.gz ./
 # tar tvzf AAA.tar.gz
 drwxr-xr-x root/root         0 2012-06-25 13:58:04 ./
 -rw-r--r-- root/root       185 2012-06-25 13:57:43 ./hosts
 -rw-r--r-- root/root         0 2012-06-25 13:58:04 ./AAA.tar.gz  (the stored archive) 

Environment

  • Red Hat Enterprise Linux 5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.