tar: [filename] : Cannot stat: No such file or directory

Solution Verified - Updated -

Issue

  • The following error is encountered when I run tar to create a compressed archive.
# ls /tmp/work
file_1  file_10  file_2  file_3  file_4  file_5  file_6  file_7  file_8  file_9

# tar czvf --warning=no-file-changed /tmp/file.tar.gz /tmp/work/*
tar: Removing leading `/' from member names
tar: /tmp/file.tar.gz: Cannot stat: No such file or directory
/tmp/work/file_1
/tmp/work/file_10
/tmp/work/file_2
/tmp/work/file_3
/tmp/work/file_4
/tmp/work/file_5
/tmp/work/file_6
/tmp/work/file_7
/tmp/work/file_8
/tmp/work/file_9
tar: Exiting with failure status due to previous errors
  • What does this error mean? How do I prevent this error?

Environment

  • Red Hat Enterprise Linux All
  • tar

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content