Using calibre from the command line

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











up vote
2
down vote

favorite












Using calibre from the command line, in debian testing, how can I insert a tag with the syntax being



 ebook-meta ebook_file --tags rhubarb


but for a range of files, but all by the same author so just need the tag of his/her name?



This is used for indexing and sorting out books on a Kindle.










share|improve this question



























    up vote
    2
    down vote

    favorite












    Using calibre from the command line, in debian testing, how can I insert a tag with the syntax being



     ebook-meta ebook_file --tags rhubarb


    but for a range of files, but all by the same author so just need the tag of his/her name?



    This is used for indexing and sorting out books on a Kindle.










    share|improve this question

























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      Using calibre from the command line, in debian testing, how can I insert a tag with the syntax being



       ebook-meta ebook_file --tags rhubarb


      but for a range of files, but all by the same author so just need the tag of his/her name?



      This is used for indexing and sorting out books on a Kindle.










      share|improve this question















      Using calibre from the command line, in debian testing, how can I insert a tag with the syntax being



       ebook-meta ebook_file --tags rhubarb


      but for a range of files, but all by the same author so just need the tag of his/her name?



      This is used for indexing and sorting out books on a Kindle.







      shell command-line calibre






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 20 at 22:27









      Rui F Ribeiro

      38.2k1475125




      38.2k1475125










      asked Sep 1 '13 at 4:31









      boudiccas

      143211




      143211




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote













          The easiest way, assuming all the relevant files are in the same directory, is:



          for f in *; do ebook-meta "$f" --tags rhubarb


          If the files can be in various sub directories, use find (this assumes that the only files in all sub directories are ebooks. Since this is likely not true, you should use something additional like -name "*.ebook" or whatever extension your ebooks have):



          find . -type f -exec ebook-meta '' --tags rhubarb ;





          share|improve this answer






















          • @ChrisDown argh, thanks, forgot the quotes which were the whole point of the answer.
            – terdon
            Sep 1 '13 at 14:32










          • @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C Doesn't work, but I cant see why. Any ideas please?
            – boudiccas
            Sep 1 '13 at 15:11










          • find . -type f exec ebook-meta '' --tags wilbur-smith ; find: paths must precede expression: exec Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
            – boudiccas
            Sep 1 '13 at 15:12










          • There was a '-' missing before 'exec'.
            – Dubu
            Sep 1 '13 at 17:14










          • @user205787 as Dubu pointed out, I had forgotten the - before -exec, try again with the modified answer.
            – terdon
            Sep 1 '13 at 17:20

















          up vote
          0
          down vote













          You must have the ebooks of an author in a directory. cd to this directory an run:



          for var in $(ls); do ebook-meta $var --tags rhubarb; done



          if the filename has spaces, you must modify the IFS (Internal Field Separator):



          oldIFS=$IFS
          IFS='n'
          for var in $(ls); do ebook-meta $var --tags rhubarb; done
          IFS=$oldIFS


          Or the same in a single command:



          oldIFS=$IFS && IFS='n' && for var in $(ls); do ebook-meta $var --tags rhubarb; done && IFS=$oldIFS






          share|improve this answer






















          • Thanks for this but its not working, this is part of the puitput -
            – boudiccas
            Sep 1 '13 at 6:27










          • Thanks for this but its not working, this is part of the output - the output is too long for here but its at paste.debian.net/33088 . I think that theres some problem with the 'cli.py' module itself
            – boudiccas
            Sep 1 '13 at 6:36






          • 4




            NEVER parse ls, and twice never when working with file names that are likely to have spaces.
            – terdon
            Sep 1 '13 at 14:13










          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: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          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%2f89033%2fusing-calibre-from-the-command-line%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          2
          down vote













          The easiest way, assuming all the relevant files are in the same directory, is:



          for f in *; do ebook-meta "$f" --tags rhubarb


          If the files can be in various sub directories, use find (this assumes that the only files in all sub directories are ebooks. Since this is likely not true, you should use something additional like -name "*.ebook" or whatever extension your ebooks have):



          find . -type f -exec ebook-meta '' --tags rhubarb ;





          share|improve this answer






















          • @ChrisDown argh, thanks, forgot the quotes which were the whole point of the answer.
            – terdon
            Sep 1 '13 at 14:32










          • @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C Doesn't work, but I cant see why. Any ideas please?
            – boudiccas
            Sep 1 '13 at 15:11










          • find . -type f exec ebook-meta '' --tags wilbur-smith ; find: paths must precede expression: exec Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
            – boudiccas
            Sep 1 '13 at 15:12










          • There was a '-' missing before 'exec'.
            – Dubu
            Sep 1 '13 at 17:14










          • @user205787 as Dubu pointed out, I had forgotten the - before -exec, try again with the modified answer.
            – terdon
            Sep 1 '13 at 17:20














          up vote
          2
          down vote













          The easiest way, assuming all the relevant files are in the same directory, is:



          for f in *; do ebook-meta "$f" --tags rhubarb


          If the files can be in various sub directories, use find (this assumes that the only files in all sub directories are ebooks. Since this is likely not true, you should use something additional like -name "*.ebook" or whatever extension your ebooks have):



          find . -type f -exec ebook-meta '' --tags rhubarb ;





          share|improve this answer






















          • @ChrisDown argh, thanks, forgot the quotes which were the whole point of the answer.
            – terdon
            Sep 1 '13 at 14:32










          • @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C Doesn't work, but I cant see why. Any ideas please?
            – boudiccas
            Sep 1 '13 at 15:11










          • find . -type f exec ebook-meta '' --tags wilbur-smith ; find: paths must precede expression: exec Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
            – boudiccas
            Sep 1 '13 at 15:12










          • There was a '-' missing before 'exec'.
            – Dubu
            Sep 1 '13 at 17:14










          • @user205787 as Dubu pointed out, I had forgotten the - before -exec, try again with the modified answer.
            – terdon
            Sep 1 '13 at 17:20












          up vote
          2
          down vote










          up vote
          2
          down vote









          The easiest way, assuming all the relevant files are in the same directory, is:



          for f in *; do ebook-meta "$f" --tags rhubarb


          If the files can be in various sub directories, use find (this assumes that the only files in all sub directories are ebooks. Since this is likely not true, you should use something additional like -name "*.ebook" or whatever extension your ebooks have):



          find . -type f -exec ebook-meta '' --tags rhubarb ;





          share|improve this answer














          The easiest way, assuming all the relevant files are in the same directory, is:



          for f in *; do ebook-meta "$f" --tags rhubarb


          If the files can be in various sub directories, use find (this assumes that the only files in all sub directories are ebooks. Since this is likely not true, you should use something additional like -name "*.ebook" or whatever extension your ebooks have):



          find . -type f -exec ebook-meta '' --tags rhubarb ;






          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Sep 1 '13 at 17:19









          Dubu

          2,3661122




          2,3661122










          answered Sep 1 '13 at 14:17









          terdon

          126k31243418




          126k31243418











          • @ChrisDown argh, thanks, forgot the quotes which were the whole point of the answer.
            – terdon
            Sep 1 '13 at 14:32










          • @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C Doesn't work, but I cant see why. Any ideas please?
            – boudiccas
            Sep 1 '13 at 15:11










          • find . -type f exec ebook-meta '' --tags wilbur-smith ; find: paths must precede expression: exec Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
            – boudiccas
            Sep 1 '13 at 15:12










          • There was a '-' missing before 'exec'.
            – Dubu
            Sep 1 '13 at 17:14










          • @user205787 as Dubu pointed out, I had forgotten the - before -exec, try again with the modified answer.
            – terdon
            Sep 1 '13 at 17:20
















          • @ChrisDown argh, thanks, forgot the quotes which were the whole point of the answer.
            – terdon
            Sep 1 '13 at 14:32










          • @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C Doesn't work, but I cant see why. Any ideas please?
            – boudiccas
            Sep 1 '13 at 15:11










          • find . -type f exec ebook-meta '' --tags wilbur-smith ; find: paths must precede expression: exec Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
            – boudiccas
            Sep 1 '13 at 15:12










          • There was a '-' missing before 'exec'.
            – Dubu
            Sep 1 '13 at 17:14










          • @user205787 as Dubu pointed out, I had forgotten the - before -exec, try again with the modified answer.
            – terdon
            Sep 1 '13 at 17:20















          @ChrisDown argh, thanks, forgot the quotes which were the whole point of the answer.
          – terdon
          Sep 1 '13 at 14:32




          @ChrisDown argh, thanks, forgot the quotes which were the whole point of the answer.
          – terdon
          Sep 1 '13 at 14:32












          @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C Doesn't work, but I cant see why. Any ideas please?
          – boudiccas
          Sep 1 '13 at 15:11




          @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C @~/kindle-backup/34-wilbur-smith-Kindle-Collection]$ [9570]>; for f in *; do ebook-meta "$f" --tags wilbur-smith > ^C Doesn't work, but I cant see why. Any ideas please?
          – boudiccas
          Sep 1 '13 at 15:11












          find . -type f exec ebook-meta '' --tags wilbur-smith ; find: paths must precede expression: exec Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
          – boudiccas
          Sep 1 '13 at 15:12




          find . -type f exec ebook-meta '' --tags wilbur-smith ; find: paths must precede expression: exec Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
          – boudiccas
          Sep 1 '13 at 15:12












          There was a '-' missing before 'exec'.
          – Dubu
          Sep 1 '13 at 17:14




          There was a '-' missing before 'exec'.
          – Dubu
          Sep 1 '13 at 17:14












          @user205787 as Dubu pointed out, I had forgotten the - before -exec, try again with the modified answer.
          – terdon
          Sep 1 '13 at 17:20




          @user205787 as Dubu pointed out, I had forgotten the - before -exec, try again with the modified answer.
          – terdon
          Sep 1 '13 at 17:20












          up vote
          0
          down vote













          You must have the ebooks of an author in a directory. cd to this directory an run:



          for var in $(ls); do ebook-meta $var --tags rhubarb; done



          if the filename has spaces, you must modify the IFS (Internal Field Separator):



          oldIFS=$IFS
          IFS='n'
          for var in $(ls); do ebook-meta $var --tags rhubarb; done
          IFS=$oldIFS


          Or the same in a single command:



          oldIFS=$IFS && IFS='n' && for var in $(ls); do ebook-meta $var --tags rhubarb; done && IFS=$oldIFS






          share|improve this answer






















          • Thanks for this but its not working, this is part of the puitput -
            – boudiccas
            Sep 1 '13 at 6:27










          • Thanks for this but its not working, this is part of the output - the output is too long for here but its at paste.debian.net/33088 . I think that theres some problem with the 'cli.py' module itself
            – boudiccas
            Sep 1 '13 at 6:36






          • 4




            NEVER parse ls, and twice never when working with file names that are likely to have spaces.
            – terdon
            Sep 1 '13 at 14:13














          up vote
          0
          down vote













          You must have the ebooks of an author in a directory. cd to this directory an run:



          for var in $(ls); do ebook-meta $var --tags rhubarb; done



          if the filename has spaces, you must modify the IFS (Internal Field Separator):



          oldIFS=$IFS
          IFS='n'
          for var in $(ls); do ebook-meta $var --tags rhubarb; done
          IFS=$oldIFS


          Or the same in a single command:



          oldIFS=$IFS && IFS='n' && for var in $(ls); do ebook-meta $var --tags rhubarb; done && IFS=$oldIFS






          share|improve this answer






















          • Thanks for this but its not working, this is part of the puitput -
            – boudiccas
            Sep 1 '13 at 6:27










          • Thanks for this but its not working, this is part of the output - the output is too long for here but its at paste.debian.net/33088 . I think that theres some problem with the 'cli.py' module itself
            – boudiccas
            Sep 1 '13 at 6:36






          • 4




            NEVER parse ls, and twice never when working with file names that are likely to have spaces.
            – terdon
            Sep 1 '13 at 14:13












          up vote
          0
          down vote










          up vote
          0
          down vote









          You must have the ebooks of an author in a directory. cd to this directory an run:



          for var in $(ls); do ebook-meta $var --tags rhubarb; done



          if the filename has spaces, you must modify the IFS (Internal Field Separator):



          oldIFS=$IFS
          IFS='n'
          for var in $(ls); do ebook-meta $var --tags rhubarb; done
          IFS=$oldIFS


          Or the same in a single command:



          oldIFS=$IFS && IFS='n' && for var in $(ls); do ebook-meta $var --tags rhubarb; done && IFS=$oldIFS






          share|improve this answer














          You must have the ebooks of an author in a directory. cd to this directory an run:



          for var in $(ls); do ebook-meta $var --tags rhubarb; done



          if the filename has spaces, you must modify the IFS (Internal Field Separator):



          oldIFS=$IFS
          IFS='n'
          for var in $(ls); do ebook-meta $var --tags rhubarb; done
          IFS=$oldIFS


          Or the same in a single command:



          oldIFS=$IFS && IFS='n' && for var in $(ls); do ebook-meta $var --tags rhubarb; done && IFS=$oldIFS







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Sep 1 '13 at 5:29

























          answered Sep 1 '13 at 5:03









          mavillan

          1,42441525




          1,42441525











          • Thanks for this but its not working, this is part of the puitput -
            – boudiccas
            Sep 1 '13 at 6:27










          • Thanks for this but its not working, this is part of the output - the output is too long for here but its at paste.debian.net/33088 . I think that theres some problem with the 'cli.py' module itself
            – boudiccas
            Sep 1 '13 at 6:36






          • 4




            NEVER parse ls, and twice never when working with file names that are likely to have spaces.
            – terdon
            Sep 1 '13 at 14:13
















          • Thanks for this but its not working, this is part of the puitput -
            – boudiccas
            Sep 1 '13 at 6:27










          • Thanks for this but its not working, this is part of the output - the output is too long for here but its at paste.debian.net/33088 . I think that theres some problem with the 'cli.py' module itself
            – boudiccas
            Sep 1 '13 at 6:36






          • 4




            NEVER parse ls, and twice never when working with file names that are likely to have spaces.
            – terdon
            Sep 1 '13 at 14:13















          Thanks for this but its not working, this is part of the puitput -
          – boudiccas
          Sep 1 '13 at 6:27




          Thanks for this but its not working, this is part of the puitput -
          – boudiccas
          Sep 1 '13 at 6:27












          Thanks for this but its not working, this is part of the output - the output is too long for here but its at paste.debian.net/33088 . I think that theres some problem with the 'cli.py' module itself
          – boudiccas
          Sep 1 '13 at 6:36




          Thanks for this but its not working, this is part of the output - the output is too long for here but its at paste.debian.net/33088 . I think that theres some problem with the 'cli.py' module itself
          – boudiccas
          Sep 1 '13 at 6:36




          4




          4




          NEVER parse ls, and twice never when working with file names that are likely to have spaces.
          – terdon
          Sep 1 '13 at 14:13




          NEVER parse ls, and twice never when working with file names that are likely to have spaces.
          – terdon
          Sep 1 '13 at 14:13

















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f89033%2fusing-calibre-from-the-command-line%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown






          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