Issues with tar, “remove leading /” and the --file option [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite













This question already has an answer here:



  • tar: Removing leading `/' from member names

    7 answers



When I specify root-folders in my tar command-line I deliberately prefix with "/" to tell tar it is root-folders and not sub-folders of current folder.



E.g.



tar --create --file="/tmp/test.tar" "/tmp/Folder 1/"
tar: Removing leading `/' from member names


Why is the leading "/" removed?



In regards to the -f / --file= option:

If you want to output to stdout you use -f - but it seems you cannot use --file= -.

I thought -f and --file were aliases to each other?



Beside I cannot find the -f - option in the manual (man tar)...shouldn't it be there? or have I just overlooked it.







share|improve this question













marked as duplicate by harish.venkat, Jesse_b, G-Man, Jeff Schaller, Vlastimil May 3 at 6:30


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1




    @BMWW If you ask two questions in one, it can happen it will get closed as duplicate, altough only one of the questions has been answered before.
    – Philippos
    May 2 at 15:42














up vote
1
down vote

favorite













This question already has an answer here:



  • tar: Removing leading `/' from member names

    7 answers



When I specify root-folders in my tar command-line I deliberately prefix with "/" to tell tar it is root-folders and not sub-folders of current folder.



E.g.



tar --create --file="/tmp/test.tar" "/tmp/Folder 1/"
tar: Removing leading `/' from member names


Why is the leading "/" removed?



In regards to the -f / --file= option:

If you want to output to stdout you use -f - but it seems you cannot use --file= -.

I thought -f and --file were aliases to each other?



Beside I cannot find the -f - option in the manual (man tar)...shouldn't it be there? or have I just overlooked it.







share|improve this question













marked as duplicate by harish.venkat, Jesse_b, G-Man, Jeff Schaller, Vlastimil May 3 at 6:30


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.










  • 1




    @BMWW If you ask two questions in one, it can happen it will get closed as duplicate, altough only one of the questions has been answered before.
    – Philippos
    May 2 at 15:42












up vote
1
down vote

favorite









up vote
1
down vote

favorite












This question already has an answer here:



  • tar: Removing leading `/' from member names

    7 answers



When I specify root-folders in my tar command-line I deliberately prefix with "/" to tell tar it is root-folders and not sub-folders of current folder.



E.g.



tar --create --file="/tmp/test.tar" "/tmp/Folder 1/"
tar: Removing leading `/' from member names


Why is the leading "/" removed?



In regards to the -f / --file= option:

If you want to output to stdout you use -f - but it seems you cannot use --file= -.

I thought -f and --file were aliases to each other?



Beside I cannot find the -f - option in the manual (man tar)...shouldn't it be there? or have I just overlooked it.







share|improve this question














This question already has an answer here:



  • tar: Removing leading `/' from member names

    7 answers



When I specify root-folders in my tar command-line I deliberately prefix with "/" to tell tar it is root-folders and not sub-folders of current folder.



E.g.



tar --create --file="/tmp/test.tar" "/tmp/Folder 1/"
tar: Removing leading `/' from member names


Why is the leading "/" removed?



In regards to the -f / --file= option:

If you want to output to stdout you use -f - but it seems you cannot use --file= -.

I thought -f and --file were aliases to each other?



Beside I cannot find the -f - option in the manual (man tar)...shouldn't it be there? or have I just overlooked it.





This question already has an answer here:



  • tar: Removing leading `/' from member names

    7 answers









share|improve this question












share|improve this question




share|improve this question








edited May 2 at 18:28









Hauke Laging

53.2k1282130




53.2k1282130









asked May 2 at 15:10









BMWW

436




436




marked as duplicate by harish.venkat, Jesse_b, G-Man, Jeff Schaller, Vlastimil May 3 at 6:30


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by harish.venkat, Jesse_b, G-Man, Jeff Schaller, Vlastimil May 3 at 6:30


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









  • 1




    @BMWW If you ask two questions in one, it can happen it will get closed as duplicate, altough only one of the questions has been answered before.
    – Philippos
    May 2 at 15:42












  • 1




    @BMWW If you ask two questions in one, it can happen it will get closed as duplicate, altough only one of the questions has been answered before.
    – Philippos
    May 2 at 15:42







1




1




@BMWW If you ask two questions in one, it can happen it will get closed as duplicate, altough only one of the questions has been answered before.
– Philippos
May 2 at 15:42




@BMWW If you ask two questions in one, it can happen it will get closed as duplicate, altough only one of the questions has been answered before.
– Philippos
May 2 at 15:42










2 Answers
2






active

oldest

votes

















up vote
2
down vote













Tar writes to stdout or reads from stdin by default, so there is no need for the dash character to mean stdout/stdin. Just leave out the -f parameter. You got a syntax error for --file= - because of the space between = and -. Long options with -- are written --param=value without spaces around the equals sign.






share|improve this answer




























    up vote
    1
    down vote













    Try to avoid using full path when specifying the directory path, use relative path, it will be easier when restoring.






    share|improve this answer






























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      2
      down vote













      Tar writes to stdout or reads from stdin by default, so there is no need for the dash character to mean stdout/stdin. Just leave out the -f parameter. You got a syntax error for --file= - because of the space between = and -. Long options with -- are written --param=value without spaces around the equals sign.






      share|improve this answer

























        up vote
        2
        down vote













        Tar writes to stdout or reads from stdin by default, so there is no need for the dash character to mean stdout/stdin. Just leave out the -f parameter. You got a syntax error for --file= - because of the space between = and -. Long options with -- are written --param=value without spaces around the equals sign.






        share|improve this answer























          up vote
          2
          down vote










          up vote
          2
          down vote









          Tar writes to stdout or reads from stdin by default, so there is no need for the dash character to mean stdout/stdin. Just leave out the -f parameter. You got a syntax error for --file= - because of the space between = and -. Long options with -- are written --param=value without spaces around the equals sign.






          share|improve this answer













          Tar writes to stdout or reads from stdin by default, so there is no need for the dash character to mean stdout/stdin. Just leave out the -f parameter. You got a syntax error for --file= - because of the space between = and -. Long options with -- are written --param=value without spaces around the equals sign.







          share|improve this answer













          share|improve this answer



          share|improve this answer











          answered May 2 at 15:50









          Johan Myréen

          6,76711221




          6,76711221






















              up vote
              1
              down vote













              Try to avoid using full path when specifying the directory path, use relative path, it will be easier when restoring.






              share|improve this answer



























                up vote
                1
                down vote













                Try to avoid using full path when specifying the directory path, use relative path, it will be easier when restoring.






                share|improve this answer

























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  Try to avoid using full path when specifying the directory path, use relative path, it will be easier when restoring.






                  share|improve this answer















                  Try to avoid using full path when specifying the directory path, use relative path, it will be easier when restoring.







                  share|improve this answer















                  share|improve this answer



                  share|improve this answer








                  edited May 17 at 13:54


























                  answered May 2 at 18:41









                  José Castillo Lema

                  25119




                  25119












                      Popular posts from this blog

                      How to check contact read email or not when send email to Individual?

                      Bahrain

                      Postfix configuration issue with fips on centos 7; mailgun relay