Results 1 to 7 of 7
I'M working through a Linux book and it's showing how to use tar, the book uses CentOS. I was told to use the command:
Code:
tar -cf demofile.tar file1.txt file2.txt ...
- 11-26-2011 #1Just Joined!
- Join Date
- Dec 2010
- Posts
- 66
tar -cf
I'M working through a Linux book and it's showing how to use tar, the book uses CentOS. I was told to use the command:
the book also stated that this would create the archive demofile.tar including the file file1.txt, file2.txt, and file3.txtCode:tar -cf demofile.tar file1.txt file2.txt file3.txt
After typing this in this is what I got:
[root@localhost demo]# tar -cf demofile.tar file1.txt file2.txt file3.txt
tar: file1.txt: Cannot stat: No such file or directory
tar: file2.txt: Cannot stat: No such file or directory
tar: file3.txt: Cannot stat: No such file or directory
tar: Exiting with failure status due to previous errors
Thanks for any and all replies.
- 11-26-2011 #2
Have you actually created those files? If you have, then they don't seem to be in the directory you are working in.
"I'm just a little old lady; don't try to dazzle me with jargon!"
- 11-26-2011 #3
Hazel is correct. The book is using file1.txt file2.txt file3.txt as examples and you should substitute those examples with files that you have created for this exercise. You can use the same names as the examples or you can change them, just be sure to adjust your command if you do change the name of the examples.
I do not respond to private messages asking for Linux help, Please keep it on the forums only.
All new users please read this.** Forum FAQS. ** Adopt an unanswered post.
- 11-26-2011 #4Linux Guru
- Join Date
- May 2011
- Posts
- 1,843
Also, one thing I have learned is, the Linux userland tools are usually pretty good at telling you why they are unhappy (versus Windows ones, for example). You just have to get good at figuring out some of the "short-hand" they use some times. In other words, the tar command is telling you, as it iterates over each file, that it cannot find it (it uses an underlying "stat" function).
This is why you'll always see us on the boards telling people with problems to please post any error messages they received (which you wisely already did!).
- 11-26-2011 #5Just Joined!
- Join Date
- Dec 2010
- Posts
- 66
It worked after I created the file. I thing is, the Linux book I'M reading was telling me that the command would create the files if they did not already exist.
- 11-27-2011 #6
Well, either the book is wrong, outdated or you misunderstood it. I'm not much of a programmer but I see nothing in that command that would create those files for you.
I do not respond to private messages asking for Linux help, Please keep it on the forums only.
All new users please read this.** Forum FAQS. ** Adopt an unanswered post.
- 11-27-2011 #7
@Garrett85:
Since you mention a file (singular), what filename did you create?It worked after I created the file.
And what filenamess did you expect to be created?...the command would create the files if they did not already exist.
I just want to make sure that we're all on the right path.Jay
New users, read this first.
New Member FAQ
Registered Linux User #463940
I do not respond to Private Messages asking for Linux help. Please, keep it on the public boards.


Reply With Quote