Directing output from command to folder

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











up vote
0
down vote

favorite












I am using pdfdetach utility which would extract embedded objects in PDF files and dump them to the current folder. Output can be anything such as .doc files or others. All I want to do is that whatever the output of the pdfdetach, I want it to be stored in sub-directory instead of current directory by default.



Here is the simple line I am trying but is not working:



pdfdetach -saveall JSPopupCalendar.pdf > /subfolder/









share|improve this question



























    up vote
    0
    down vote

    favorite












    I am using pdfdetach utility which would extract embedded objects in PDF files and dump them to the current folder. Output can be anything such as .doc files or others. All I want to do is that whatever the output of the pdfdetach, I want it to be stored in sub-directory instead of current directory by default.



    Here is the simple line I am trying but is not working:



    pdfdetach -saveall JSPopupCalendar.pdf > /subfolder/









    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am using pdfdetach utility which would extract embedded objects in PDF files and dump them to the current folder. Output can be anything such as .doc files or others. All I want to do is that whatever the output of the pdfdetach, I want it to be stored in sub-directory instead of current directory by default.



      Here is the simple line I am trying but is not working:



      pdfdetach -saveall JSPopupCalendar.pdf > /subfolder/









      share|improve this question















      I am using pdfdetach utility which would extract embedded objects in PDF files and dump them to the current folder. Output can be anything such as .doc files or others. All I want to do is that whatever the output of the pdfdetach, I want it to be stored in sub-directory instead of current directory by default.



      Here is the simple line I am trying but is not working:



      pdfdetach -saveall JSPopupCalendar.pdf > /subfolder/






      bash shell-script pdf






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Sep 7 at 21:40









      Rui F Ribeiro

      36.8k1273117




      36.8k1273117










      asked Sep 7 at 21:32









      ksa_coder

      1084




      1084




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          2
          down vote



          accepted










          Use the "-o" argument. e.g. pdfdetach -saveall JSPopupCalendar.pdf -o /subfolder



          See man page http://manpages.ubuntu.com/manpages/trusty/man1/pdfdetach.1.html




          -saveall



          Save all of the embedded files. This uses the file names associated with the
          embedded files (as printed by the "-list" switch). By default, the files are saved
          in the current directory; this can be changed with the "-o" switch.



          -o path



          Set the file name used when saving an embedded file with the "-save"
          switch, or the
          directory used by "-saveall".




          Example, showing how we detach the KSBASE.WQ2 file from inside fileAttachment.pdf.



          $ pdfdetach -saveall fileAttachment.pdf -o bar
          $ find . -ls
          384329 0 drwxrwxr-x 3 steve steve 43 Sep 7 17:42 .
          9137752 0 drwxrwxr-x 2 steve steve 24 Sep 7 17:42 ./bar
          8544834 24 -rw-rw-r-- 1 steve steve 20668 Sep 7 17:42 ./bar/KSBASE.WQ2
          384331 80 -rw-rw-r-- 1 steve steve 78950 Nov 2 2017 ./fileAttachment.pdf
          $





          share|improve this answer






















          • Hi Steve. i tried this prior to posting and for reassurance, I tried it again now. I keep getting this error in terminal: I/O Error: Error saving embedded file as ''
            – ksa_coder
            Sep 8 at 21:34






          • 1




            Please update your question to include (1) initial output of find . -ls, (2) exact pdfdetach command and subsequent output seen when fails, and (3) output of pdfdetach -list JSPopupCalendar.pdf
            – steve
            Sep 8 at 21:39






          • 1




            Brilliant! To do as requested, I deleted the output that was generated previously by the command. Then when I tried the command again, it worked. So apparently you get that error message when a file with the same name in the directory exist. Thanks Steve
            – ksa_coder
            Sep 8 at 21:44










          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f467626%2fdirecting-output-from-command-to-folder%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote



          accepted










          Use the "-o" argument. e.g. pdfdetach -saveall JSPopupCalendar.pdf -o /subfolder



          See man page http://manpages.ubuntu.com/manpages/trusty/man1/pdfdetach.1.html




          -saveall



          Save all of the embedded files. This uses the file names associated with the
          embedded files (as printed by the "-list" switch). By default, the files are saved
          in the current directory; this can be changed with the "-o" switch.



          -o path



          Set the file name used when saving an embedded file with the "-save"
          switch, or the
          directory used by "-saveall".




          Example, showing how we detach the KSBASE.WQ2 file from inside fileAttachment.pdf.



          $ pdfdetach -saveall fileAttachment.pdf -o bar
          $ find . -ls
          384329 0 drwxrwxr-x 3 steve steve 43 Sep 7 17:42 .
          9137752 0 drwxrwxr-x 2 steve steve 24 Sep 7 17:42 ./bar
          8544834 24 -rw-rw-r-- 1 steve steve 20668 Sep 7 17:42 ./bar/KSBASE.WQ2
          384331 80 -rw-rw-r-- 1 steve steve 78950 Nov 2 2017 ./fileAttachment.pdf
          $





          share|improve this answer






















          • Hi Steve. i tried this prior to posting and for reassurance, I tried it again now. I keep getting this error in terminal: I/O Error: Error saving embedded file as ''
            – ksa_coder
            Sep 8 at 21:34






          • 1




            Please update your question to include (1) initial output of find . -ls, (2) exact pdfdetach command and subsequent output seen when fails, and (3) output of pdfdetach -list JSPopupCalendar.pdf
            – steve
            Sep 8 at 21:39






          • 1




            Brilliant! To do as requested, I deleted the output that was generated previously by the command. Then when I tried the command again, it worked. So apparently you get that error message when a file with the same name in the directory exist. Thanks Steve
            – ksa_coder
            Sep 8 at 21:44














          up vote
          2
          down vote



          accepted










          Use the "-o" argument. e.g. pdfdetach -saveall JSPopupCalendar.pdf -o /subfolder



          See man page http://manpages.ubuntu.com/manpages/trusty/man1/pdfdetach.1.html




          -saveall



          Save all of the embedded files. This uses the file names associated with the
          embedded files (as printed by the "-list" switch). By default, the files are saved
          in the current directory; this can be changed with the "-o" switch.



          -o path



          Set the file name used when saving an embedded file with the "-save"
          switch, or the
          directory used by "-saveall".




          Example, showing how we detach the KSBASE.WQ2 file from inside fileAttachment.pdf.



          $ pdfdetach -saveall fileAttachment.pdf -o bar
          $ find . -ls
          384329 0 drwxrwxr-x 3 steve steve 43 Sep 7 17:42 .
          9137752 0 drwxrwxr-x 2 steve steve 24 Sep 7 17:42 ./bar
          8544834 24 -rw-rw-r-- 1 steve steve 20668 Sep 7 17:42 ./bar/KSBASE.WQ2
          384331 80 -rw-rw-r-- 1 steve steve 78950 Nov 2 2017 ./fileAttachment.pdf
          $





          share|improve this answer






















          • Hi Steve. i tried this prior to posting and for reassurance, I tried it again now. I keep getting this error in terminal: I/O Error: Error saving embedded file as ''
            – ksa_coder
            Sep 8 at 21:34






          • 1




            Please update your question to include (1) initial output of find . -ls, (2) exact pdfdetach command and subsequent output seen when fails, and (3) output of pdfdetach -list JSPopupCalendar.pdf
            – steve
            Sep 8 at 21:39






          • 1




            Brilliant! To do as requested, I deleted the output that was generated previously by the command. Then when I tried the command again, it worked. So apparently you get that error message when a file with the same name in the directory exist. Thanks Steve
            – ksa_coder
            Sep 8 at 21:44












          up vote
          2
          down vote



          accepted







          up vote
          2
          down vote



          accepted






          Use the "-o" argument. e.g. pdfdetach -saveall JSPopupCalendar.pdf -o /subfolder



          See man page http://manpages.ubuntu.com/manpages/trusty/man1/pdfdetach.1.html




          -saveall



          Save all of the embedded files. This uses the file names associated with the
          embedded files (as printed by the "-list" switch). By default, the files are saved
          in the current directory; this can be changed with the "-o" switch.



          -o path



          Set the file name used when saving an embedded file with the "-save"
          switch, or the
          directory used by "-saveall".




          Example, showing how we detach the KSBASE.WQ2 file from inside fileAttachment.pdf.



          $ pdfdetach -saveall fileAttachment.pdf -o bar
          $ find . -ls
          384329 0 drwxrwxr-x 3 steve steve 43 Sep 7 17:42 .
          9137752 0 drwxrwxr-x 2 steve steve 24 Sep 7 17:42 ./bar
          8544834 24 -rw-rw-r-- 1 steve steve 20668 Sep 7 17:42 ./bar/KSBASE.WQ2
          384331 80 -rw-rw-r-- 1 steve steve 78950 Nov 2 2017 ./fileAttachment.pdf
          $





          share|improve this answer














          Use the "-o" argument. e.g. pdfdetach -saveall JSPopupCalendar.pdf -o /subfolder



          See man page http://manpages.ubuntu.com/manpages/trusty/man1/pdfdetach.1.html




          -saveall



          Save all of the embedded files. This uses the file names associated with the
          embedded files (as printed by the "-list" switch). By default, the files are saved
          in the current directory; this can be changed with the "-o" switch.



          -o path



          Set the file name used when saving an embedded file with the "-save"
          switch, or the
          directory used by "-saveall".




          Example, showing how we detach the KSBASE.WQ2 file from inside fileAttachment.pdf.



          $ pdfdetach -saveall fileAttachment.pdf -o bar
          $ find . -ls
          384329 0 drwxrwxr-x 3 steve steve 43 Sep 7 17:42 .
          9137752 0 drwxrwxr-x 2 steve steve 24 Sep 7 17:42 ./bar
          8544834 24 -rw-rw-r-- 1 steve steve 20668 Sep 7 17:42 ./bar/KSBASE.WQ2
          384331 80 -rw-rw-r-- 1 steve steve 78950 Nov 2 2017 ./fileAttachment.pdf
          $






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Sep 7 at 22:19









          DopeGhoti

          41.2k55180




          41.2k55180










          answered Sep 7 at 21:39









          steve

          13k22249




          13k22249











          • Hi Steve. i tried this prior to posting and for reassurance, I tried it again now. I keep getting this error in terminal: I/O Error: Error saving embedded file as ''
            – ksa_coder
            Sep 8 at 21:34






          • 1




            Please update your question to include (1) initial output of find . -ls, (2) exact pdfdetach command and subsequent output seen when fails, and (3) output of pdfdetach -list JSPopupCalendar.pdf
            – steve
            Sep 8 at 21:39






          • 1




            Brilliant! To do as requested, I deleted the output that was generated previously by the command. Then when I tried the command again, it worked. So apparently you get that error message when a file with the same name in the directory exist. Thanks Steve
            – ksa_coder
            Sep 8 at 21:44
















          • Hi Steve. i tried this prior to posting and for reassurance, I tried it again now. I keep getting this error in terminal: I/O Error: Error saving embedded file as ''
            – ksa_coder
            Sep 8 at 21:34






          • 1




            Please update your question to include (1) initial output of find . -ls, (2) exact pdfdetach command and subsequent output seen when fails, and (3) output of pdfdetach -list JSPopupCalendar.pdf
            – steve
            Sep 8 at 21:39






          • 1




            Brilliant! To do as requested, I deleted the output that was generated previously by the command. Then when I tried the command again, it worked. So apparently you get that error message when a file with the same name in the directory exist. Thanks Steve
            – ksa_coder
            Sep 8 at 21:44















          Hi Steve. i tried this prior to posting and for reassurance, I tried it again now. I keep getting this error in terminal: I/O Error: Error saving embedded file as ''
          – ksa_coder
          Sep 8 at 21:34




          Hi Steve. i tried this prior to posting and for reassurance, I tried it again now. I keep getting this error in terminal: I/O Error: Error saving embedded file as ''
          – ksa_coder
          Sep 8 at 21:34




          1




          1




          Please update your question to include (1) initial output of find . -ls, (2) exact pdfdetach command and subsequent output seen when fails, and (3) output of pdfdetach -list JSPopupCalendar.pdf
          – steve
          Sep 8 at 21:39




          Please update your question to include (1) initial output of find . -ls, (2) exact pdfdetach command and subsequent output seen when fails, and (3) output of pdfdetach -list JSPopupCalendar.pdf
          – steve
          Sep 8 at 21:39




          1




          1




          Brilliant! To do as requested, I deleted the output that was generated previously by the command. Then when I tried the command again, it worked. So apparently you get that error message when a file with the same name in the directory exist. Thanks Steve
          – ksa_coder
          Sep 8 at 21:44




          Brilliant! To do as requested, I deleted the output that was generated previously by the command. Then when I tried the command again, it worked. So apparently you get that error message when a file with the same name in the directory exist. Thanks Steve
          – ksa_coder
          Sep 8 at 21:44

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f467626%2fdirecting-output-from-command-to-folder%23new-answer', 'question_page');

          );

          Post as a guest













































































          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