Closed kmmon closed 3 months ago
I know this one is already addressed and closed, but I just have only one small remark to this statement: "So, we should always use -f as the last flag while creating an archive." - this is not necessarily true, as e.g. tar -f archive_name -czv *.txt
would still work fine, and as you may have noticed -f
is not the last flag used in this command. I'd say understanding the tar
command usage is essential, and more important than enforcing any particular order of flags.
Thanks for the pointer @matt-kita I agree with your suggestion above.
I think we can rephrase the sentence that -f
flag should not be mixed with other flags and if you're mixing it in an automated script then consider keeping -f
as last given what comes next is the argument of -f
flag.
@kmmon I've updated the note about -f
in a previous commit. Thanks for all the input!
Using
-f
withtar
while creating archive is essential. The document uses the following:tar -cvzf myinits.tgz /etc/init.d/
I accidently used
tar -cvfz ssh.tgz /etc/ssh
and the the archive file namedz
So, I think we can add a NOTE that the
-f
considers anything after-f
as the name of the archive that needs to be created. So, we should always use-f
as the last flag while creating an archive.