LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   tar misbehaving (or else I'm lost) (https://www.linuxquestions.org/questions/linux-newbie-8/tar-misbehaving-or-else-im-lost-913237/)

bluegospel 11-12-2011 06:53 PM

tar misbehaving (or else I'm lost)
 
Okay, I'm trying to create a tar file from my shell, from the directory containing the directory I want to archive, using this command:

Code:

tar -cp bluebounty.tar bluebounty
The file I want to archive is bluebounty
I'm using the -p option because I want to preserve permissions

When the command is run, my shell spits out a barrage of strange characters and fails to create the file.

Any ideas why?

fukawi1 11-12-2011 07:12 PM

Quote:

-f, --file [HOSTNAME:]F
use archive file or device F (default "-", meaning stdin/stdout)
You need the -f option to specify the name of the tar file. As the last option

ie:
Code:

tar -cpvf bluebounty.tar bluebounty
Code:

tar -[options]f $archive_name $stuff_to_archive

bluegospel 11-12-2011 07:21 PM

Quote:

Originally Posted by fukawi1 (Post 4522577)
You need the -f option to specify the name of the tar file. As the last option

Much thanks! Very helpful.


All times are GMT -5. The time now is 10:00 AM.