How to recursively find file, concatenate into one file and simultaneously delete the original...

Why does Sonny say they call Michael "Giogali"?

When did 5 foot squares become standard in D&D?

In the comics, have any of the Robins called their costume "target attraction" for villains?

Code Golf Measurer © 2019

How to prove that invoices are really UNPAID?

Disordered Cryptic Orders

2 Guards, 3 Keys, 2 Locks

Slaad Chaos Phage: Weak Combat Ability?

Which culture used no personal names?

XDSL Internet Connection Over Optical Fibre Telephone Line?

Text on old-fashioned differential geometry

How can I learn to write better questions to test for conceptual understanding?

Dice? = Is that so?

Is a list of the most common English words copyrightable?

What does "stirring tanks" mean?

How to create a vimrc macro using :sort?

Front hydraulic disk brake is too powerful on MTB — solutions?

What‘s wrong with my proof of the Law of Total Variance?

"inuendo" in a piano score

A fast aquatic predator with multiple eyes and pupils. Would these eyes be possible?

Paper status "Accept with Shepherd". What does it really mean?

Can there be an atomic nucleus where there are more protons than neutrons?

Incorrect mmap behavior when assembly files included in the project

Can we not simply connect a battery to a RAM to prevent data loss during power cuts?



How to recursively find file, concatenate into one file and simultaneously delete the original file


Concatenating thousands of files: > vs >>Process each line from text file and delete related files from diskDelete files with same name at the end of the fileHow can I cat the contents of files found using find into a single file?Batch move all files from subdirectories to parent directory, but files have same nameHow can I recursively replace a string in file and directory names?How to find and print specific file paths with exclusions?Create new concatenated files of same name in multiple directories






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{
margin-bottom:0;
}








0

















As I understand it, I could use



find . -name '*.txt' -exec cat {} ; > all.txt



to concatenate all the text files in a directory, recursively throughout sub-directories, into a file called all.txt. The thing is, I don't have enough storage for all.txt and the original files. Is there a way to execute two commands, one after the other, so that I could delete the original file after concatenating it with all.txt?










share|improve this question







New contributor



liliest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






























    0

















    As I understand it, I could use



    find . -name '*.txt' -exec cat {} ; > all.txt



    to concatenate all the text files in a directory, recursively throughout sub-directories, into a file called all.txt. The thing is, I don't have enough storage for all.txt and the original files. Is there a way to execute two commands, one after the other, so that I could delete the original file after concatenating it with all.txt?










    share|improve this question







    New contributor



    liliest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.


























      0












      0








      0








      As I understand it, I could use



      find . -name '*.txt' -exec cat {} ; > all.txt



      to concatenate all the text files in a directory, recursively throughout sub-directories, into a file called all.txt. The thing is, I don't have enough storage for all.txt and the original files. Is there a way to execute two commands, one after the other, so that I could delete the original file after concatenating it with all.txt?










      share|improve this question







      New contributor



      liliest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      As I understand it, I could use



      find . -name '*.txt' -exec cat {} ; > all.txt



      to concatenate all the text files in a directory, recursively throughout sub-directories, into a file called all.txt. The thing is, I don't have enough storage for all.txt and the original files. Is there a way to execute two commands, one after the other, so that I could delete the original file after concatenating it with all.txt?







      bash shell find cat exec






      share|improve this question







      New contributor



      liliest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.










      share|improve this question







      New contributor



      liliest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      share|improve this question




      share|improve this question



      share|improve this question






      New contributor



      liliest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.








      asked 16 mins ago









      liliestliliest

      1




      1




      New contributor



      liliest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      New contributor




      liliest is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.



























          0






          active

          oldest

          votes













          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',
          autoActivateHeartbeat: false,
          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/4.0/"u003ecc by-sa 4.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
          });


          }
          });







          liliest is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded
















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f545627%2fhow-to-recursively-find-file-concatenate-into-one-file-and-simultaneously-delet%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown


























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          liliest is a new contributor. Be nice, and check out our Code of Conduct.










          draft saved

          draft discarded

















          liliest is a new contributor. Be nice, and check out our Code of Conduct.













          liliest is a new contributor. Be nice, and check out our Code of Conduct.












          liliest is a new contributor. Be nice, and check out our Code of Conduct.
















          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f545627%2fhow-to-recursively-find-file-concatenate-into-one-file-and-simultaneously-delet%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

          Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

          Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

          Nicolae Petrescu-Găină Cuprins Biografie | Opera | In memoriam | Varia | Controverse, incertitudini...