Shellscript Looping Through All Files in a Folder












16















I want to write a shellscript that will loop through all the files in a folder and echo "put ${filename}". Can anyone point me in the right direction?










share|improve this question


















  • 2





    What have you tried? What part of the for statement and the * operator confuse you? Can you be more specific about what you know and what you don't know about the shell?

    – S.Lott
    Dec 14 '11 at 22:15











  • Just came across this -- a warning to anyone using this as a reference -- the answers do not handle filenames with spaces properly... refer to stackoverflow.com/questions/7039130/… for a better solution!!!

    – blackghost
    Jun 2 '17 at 15:59


















16















I want to write a shellscript that will loop through all the files in a folder and echo "put ${filename}". Can anyone point me in the right direction?










share|improve this question


















  • 2





    What have you tried? What part of the for statement and the * operator confuse you? Can you be more specific about what you know and what you don't know about the shell?

    – S.Lott
    Dec 14 '11 at 22:15











  • Just came across this -- a warning to anyone using this as a reference -- the answers do not handle filenames with spaces properly... refer to stackoverflow.com/questions/7039130/… for a better solution!!!

    – blackghost
    Jun 2 '17 at 15:59
















16












16








16


3






I want to write a shellscript that will loop through all the files in a folder and echo "put ${filename}". Can anyone point me in the right direction?










share|improve this question














I want to write a shellscript that will loop through all the files in a folder and echo "put ${filename}". Can anyone point me in the right direction?







bash shell loops






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Dec 14 '11 at 22:14









sklineskline

120127




120127








  • 2





    What have you tried? What part of the for statement and the * operator confuse you? Can you be more specific about what you know and what you don't know about the shell?

    – S.Lott
    Dec 14 '11 at 22:15











  • Just came across this -- a warning to anyone using this as a reference -- the answers do not handle filenames with spaces properly... refer to stackoverflow.com/questions/7039130/… for a better solution!!!

    – blackghost
    Jun 2 '17 at 15:59
















  • 2





    What have you tried? What part of the for statement and the * operator confuse you? Can you be more specific about what you know and what you don't know about the shell?

    – S.Lott
    Dec 14 '11 at 22:15











  • Just came across this -- a warning to anyone using this as a reference -- the answers do not handle filenames with spaces properly... refer to stackoverflow.com/questions/7039130/… for a better solution!!!

    – blackghost
    Jun 2 '17 at 15:59










2




2





What have you tried? What part of the for statement and the * operator confuse you? Can you be more specific about what you know and what you don't know about the shell?

– S.Lott
Dec 14 '11 at 22:15





What have you tried? What part of the for statement and the * operator confuse you? Can you be more specific about what you know and what you don't know about the shell?

– S.Lott
Dec 14 '11 at 22:15













Just came across this -- a warning to anyone using this as a reference -- the answers do not handle filenames with spaces properly... refer to stackoverflow.com/questions/7039130/… for a better solution!!!

– blackghost
Jun 2 '17 at 15:59







Just came across this -- a warning to anyone using this as a reference -- the answers do not handle filenames with spaces properly... refer to stackoverflow.com/questions/7039130/… for a better solution!!!

– blackghost
Jun 2 '17 at 15:59














6 Answers
6






active

oldest

votes


















21














For files and directories, not recursive



for filename in *; do echo "put ${filename}"; done


For files only (excludes folders), not recursive



for file in *; do 
if [ -f "$file" ]; then
echo "$file"
fi
done


For a recursive solution, see Bennet Yee's answer.






share|improve this answer





















  • 1





    If the current directory happens to be empty, this outputs "put *" rather than correctly outputting nothing. Can it be fixed?

    – JWWalker
    Apr 27 '13 at 1:47











  • @ThisClark - Indeed it does. But I'm not sure that an answer not doing exactly what you want is a good reason to downvote.

    – Oliver Charlesworth
    Sep 3 '18 at 16:52











  • @ThisClark - True. But being generous to myself (!), one could argue that from a *nix perspective, a folder is is a file. (Possibly that's what I was thinking when I wrote the answer 7 years ago, but who knows...)

    – Oliver Charlesworth
    Sep 3 '18 at 17:07











  • What does nix even stand for? Disregarding the distinction of files from folders is not helpful.

    – ThisClark
    Sep 3 '18 at 17:38





















6














recursively, including files in subdirectories?



find dir -type f -exec echo "put {}" ;


only files in that directory?



find dir -maxdepth 1 -type f -exec echo "put {}" ;





share|improve this answer





















  • 1





    I get the error find 'dir': No such file or directory when trying this.

    – gbmhunter
    Dec 19 '13 at 22:44






  • 1





    Silly me, by dir you meant replace with the directory you want. Still, slightly confusing!

    – gbmhunter
    Dec 19 '13 at 22:45











  • Recursively for files in the current directory, replace dir with *.

    – ThisClark
    Sep 3 '18 at 17:45



















4














For all folders and files in the current directory



for file in *; do
echo "put $file"
done


Or, if you want to include subdirectories and files only:



find . -type f -exec echo put {} ;


If you want to include the folders themselves, take out the -type f part.






share|improve this answer

































    2














    If you don't have any files, then instead of printing * we can do this.



    format=*.txt
    for i in $format;
    do
    if [[ "$i" == "$format" ]]
    then
    echo "No Files"
    else
    echo "file name $i"
    fi
    done





    share|improve this answer

































      1














      One more alternative using ls and sed:



      $ ls -1 <dir> | sed -e 's/^/put /'


      and using ls and xargs:



      $ ls -1 <dir> | xargs -n1 -i%f echo 'put %f'





      share|improve this answer


























      • +1, but -1 is not needed and you can do sed -e 's/^/put /'

        – William Pursell
        Dec 15 '11 at 1:12











      • @WilliamPursell Thanks, I've updated my response. Somehow, I misunderstood and made the braces and the dollar sign part of the solution. Also, I'ved another solution with xargs and echo, but the sed one is still more concise.

        – jcollado
        Dec 15 '11 at 6:05



















      0














      this will work also recursively if you have any sub directories and files inside them:



      find . -type f|awk -F"/" '{print "put ",$NF}'





      share|improve this answer























        Your Answer






        StackExchange.ifUsing("editor", function () {
        StackExchange.using("externalEditor", function () {
        StackExchange.using("snippets", function () {
        StackExchange.snippets.init();
        });
        });
        }, "code-snippets");

        StackExchange.ready(function() {
        var channelOptions = {
        tags: "".split(" "),
        id: "1"
        };
        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: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        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%2fstackoverflow.com%2fquestions%2f8512462%2fshellscript-looping-through-all-files-in-a-folder%23new-answer', 'question_page');
        }
        );

        Post as a guest















        Required, but never shown

























        6 Answers
        6






        active

        oldest

        votes








        6 Answers
        6






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        21














        For files and directories, not recursive



        for filename in *; do echo "put ${filename}"; done


        For files only (excludes folders), not recursive



        for file in *; do 
        if [ -f "$file" ]; then
        echo "$file"
        fi
        done


        For a recursive solution, see Bennet Yee's answer.






        share|improve this answer





















        • 1





          If the current directory happens to be empty, this outputs "put *" rather than correctly outputting nothing. Can it be fixed?

          – JWWalker
          Apr 27 '13 at 1:47











        • @ThisClark - Indeed it does. But I'm not sure that an answer not doing exactly what you want is a good reason to downvote.

          – Oliver Charlesworth
          Sep 3 '18 at 16:52











        • @ThisClark - True. But being generous to myself (!), one could argue that from a *nix perspective, a folder is is a file. (Possibly that's what I was thinking when I wrote the answer 7 years ago, but who knows...)

          – Oliver Charlesworth
          Sep 3 '18 at 17:07











        • What does nix even stand for? Disregarding the distinction of files from folders is not helpful.

          – ThisClark
          Sep 3 '18 at 17:38


















        21














        For files and directories, not recursive



        for filename in *; do echo "put ${filename}"; done


        For files only (excludes folders), not recursive



        for file in *; do 
        if [ -f "$file" ]; then
        echo "$file"
        fi
        done


        For a recursive solution, see Bennet Yee's answer.






        share|improve this answer





















        • 1





          If the current directory happens to be empty, this outputs "put *" rather than correctly outputting nothing. Can it be fixed?

          – JWWalker
          Apr 27 '13 at 1:47











        • @ThisClark - Indeed it does. But I'm not sure that an answer not doing exactly what you want is a good reason to downvote.

          – Oliver Charlesworth
          Sep 3 '18 at 16:52











        • @ThisClark - True. But being generous to myself (!), one could argue that from a *nix perspective, a folder is is a file. (Possibly that's what I was thinking when I wrote the answer 7 years ago, but who knows...)

          – Oliver Charlesworth
          Sep 3 '18 at 17:07











        • What does nix even stand for? Disregarding the distinction of files from folders is not helpful.

          – ThisClark
          Sep 3 '18 at 17:38
















        21












        21








        21







        For files and directories, not recursive



        for filename in *; do echo "put ${filename}"; done


        For files only (excludes folders), not recursive



        for file in *; do 
        if [ -f "$file" ]; then
        echo "$file"
        fi
        done


        For a recursive solution, see Bennet Yee's answer.






        share|improve this answer















        For files and directories, not recursive



        for filename in *; do echo "put ${filename}"; done


        For files only (excludes folders), not recursive



        for file in *; do 
        if [ -f "$file" ]; then
        echo "$file"
        fi
        done


        For a recursive solution, see Bennet Yee's answer.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Sep 3 '18 at 17:43









        ThisClark

        8,16574666




        8,16574666










        answered Dec 14 '11 at 22:16









        Oliver CharlesworthOliver Charlesworth

        227k25466598




        227k25466598








        • 1





          If the current directory happens to be empty, this outputs "put *" rather than correctly outputting nothing. Can it be fixed?

          – JWWalker
          Apr 27 '13 at 1:47











        • @ThisClark - Indeed it does. But I'm not sure that an answer not doing exactly what you want is a good reason to downvote.

          – Oliver Charlesworth
          Sep 3 '18 at 16:52











        • @ThisClark - True. But being generous to myself (!), one could argue that from a *nix perspective, a folder is is a file. (Possibly that's what I was thinking when I wrote the answer 7 years ago, but who knows...)

          – Oliver Charlesworth
          Sep 3 '18 at 17:07











        • What does nix even stand for? Disregarding the distinction of files from folders is not helpful.

          – ThisClark
          Sep 3 '18 at 17:38
















        • 1





          If the current directory happens to be empty, this outputs "put *" rather than correctly outputting nothing. Can it be fixed?

          – JWWalker
          Apr 27 '13 at 1:47











        • @ThisClark - Indeed it does. But I'm not sure that an answer not doing exactly what you want is a good reason to downvote.

          – Oliver Charlesworth
          Sep 3 '18 at 16:52











        • @ThisClark - True. But being generous to myself (!), one could argue that from a *nix perspective, a folder is is a file. (Possibly that's what I was thinking when I wrote the answer 7 years ago, but who knows...)

          – Oliver Charlesworth
          Sep 3 '18 at 17:07











        • What does nix even stand for? Disregarding the distinction of files from folders is not helpful.

          – ThisClark
          Sep 3 '18 at 17:38










        1




        1





        If the current directory happens to be empty, this outputs "put *" rather than correctly outputting nothing. Can it be fixed?

        – JWWalker
        Apr 27 '13 at 1:47





        If the current directory happens to be empty, this outputs "put *" rather than correctly outputting nothing. Can it be fixed?

        – JWWalker
        Apr 27 '13 at 1:47













        @ThisClark - Indeed it does. But I'm not sure that an answer not doing exactly what you want is a good reason to downvote.

        – Oliver Charlesworth
        Sep 3 '18 at 16:52





        @ThisClark - Indeed it does. But I'm not sure that an answer not doing exactly what you want is a good reason to downvote.

        – Oliver Charlesworth
        Sep 3 '18 at 16:52













        @ThisClark - True. But being generous to myself (!), one could argue that from a *nix perspective, a folder is is a file. (Possibly that's what I was thinking when I wrote the answer 7 years ago, but who knows...)

        – Oliver Charlesworth
        Sep 3 '18 at 17:07





        @ThisClark - True. But being generous to myself (!), one could argue that from a *nix perspective, a folder is is a file. (Possibly that's what I was thinking when I wrote the answer 7 years ago, but who knows...)

        – Oliver Charlesworth
        Sep 3 '18 at 17:07













        What does nix even stand for? Disregarding the distinction of files from folders is not helpful.

        – ThisClark
        Sep 3 '18 at 17:38







        What does nix even stand for? Disregarding the distinction of files from folders is not helpful.

        – ThisClark
        Sep 3 '18 at 17:38















        6














        recursively, including files in subdirectories?



        find dir -type f -exec echo "put {}" ;


        only files in that directory?



        find dir -maxdepth 1 -type f -exec echo "put {}" ;





        share|improve this answer





















        • 1





          I get the error find 'dir': No such file or directory when trying this.

          – gbmhunter
          Dec 19 '13 at 22:44






        • 1





          Silly me, by dir you meant replace with the directory you want. Still, slightly confusing!

          – gbmhunter
          Dec 19 '13 at 22:45











        • Recursively for files in the current directory, replace dir with *.

          – ThisClark
          Sep 3 '18 at 17:45
















        6














        recursively, including files in subdirectories?



        find dir -type f -exec echo "put {}" ;


        only files in that directory?



        find dir -maxdepth 1 -type f -exec echo "put {}" ;





        share|improve this answer





















        • 1





          I get the error find 'dir': No such file or directory when trying this.

          – gbmhunter
          Dec 19 '13 at 22:44






        • 1





          Silly me, by dir you meant replace with the directory you want. Still, slightly confusing!

          – gbmhunter
          Dec 19 '13 at 22:45











        • Recursively for files in the current directory, replace dir with *.

          – ThisClark
          Sep 3 '18 at 17:45














        6












        6








        6







        recursively, including files in subdirectories?



        find dir -type f -exec echo "put {}" ;


        only files in that directory?



        find dir -maxdepth 1 -type f -exec echo "put {}" ;





        share|improve this answer















        recursively, including files in subdirectories?



        find dir -type f -exec echo "put {}" ;


        only files in that directory?



        find dir -maxdepth 1 -type f -exec echo "put {}" ;






        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 16 '12 at 10:07









        perilbrain

        6,43712032




        6,43712032










        answered Dec 14 '11 at 22:17









        Bennet YeeBennet Yee

        36615




        36615








        • 1





          I get the error find 'dir': No such file or directory when trying this.

          – gbmhunter
          Dec 19 '13 at 22:44






        • 1





          Silly me, by dir you meant replace with the directory you want. Still, slightly confusing!

          – gbmhunter
          Dec 19 '13 at 22:45











        • Recursively for files in the current directory, replace dir with *.

          – ThisClark
          Sep 3 '18 at 17:45














        • 1





          I get the error find 'dir': No such file or directory when trying this.

          – gbmhunter
          Dec 19 '13 at 22:44






        • 1





          Silly me, by dir you meant replace with the directory you want. Still, slightly confusing!

          – gbmhunter
          Dec 19 '13 at 22:45











        • Recursively for files in the current directory, replace dir with *.

          – ThisClark
          Sep 3 '18 at 17:45








        1




        1





        I get the error find 'dir': No such file or directory when trying this.

        – gbmhunter
        Dec 19 '13 at 22:44





        I get the error find 'dir': No such file or directory when trying this.

        – gbmhunter
        Dec 19 '13 at 22:44




        1




        1





        Silly me, by dir you meant replace with the directory you want. Still, slightly confusing!

        – gbmhunter
        Dec 19 '13 at 22:45





        Silly me, by dir you meant replace with the directory you want. Still, slightly confusing!

        – gbmhunter
        Dec 19 '13 at 22:45













        Recursively for files in the current directory, replace dir with *.

        – ThisClark
        Sep 3 '18 at 17:45





        Recursively for files in the current directory, replace dir with *.

        – ThisClark
        Sep 3 '18 at 17:45











        4














        For all folders and files in the current directory



        for file in *; do
        echo "put $file"
        done


        Or, if you want to include subdirectories and files only:



        find . -type f -exec echo put {} ;


        If you want to include the folders themselves, take out the -type f part.






        share|improve this answer






























          4














          For all folders and files in the current directory



          for file in *; do
          echo "put $file"
          done


          Or, if you want to include subdirectories and files only:



          find . -type f -exec echo put {} ;


          If you want to include the folders themselves, take out the -type f part.






          share|improve this answer




























            4












            4








            4







            For all folders and files in the current directory



            for file in *; do
            echo "put $file"
            done


            Or, if you want to include subdirectories and files only:



            find . -type f -exec echo put {} ;


            If you want to include the folders themselves, take out the -type f part.






            share|improve this answer















            For all folders and files in the current directory



            for file in *; do
            echo "put $file"
            done


            Or, if you want to include subdirectories and files only:



            find . -type f -exec echo put {} ;


            If you want to include the folders themselves, take out the -type f part.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Sep 3 '18 at 17:08









            ThisClark

            8,16574666




            8,16574666










            answered Dec 14 '11 at 22:18









            KevinKevin

            38.9k1078110




            38.9k1078110























                2














                If you don't have any files, then instead of printing * we can do this.



                format=*.txt
                for i in $format;
                do
                if [[ "$i" == "$format" ]]
                then
                echo "No Files"
                else
                echo "file name $i"
                fi
                done





                share|improve this answer






























                  2














                  If you don't have any files, then instead of printing * we can do this.



                  format=*.txt
                  for i in $format;
                  do
                  if [[ "$i" == "$format" ]]
                  then
                  echo "No Files"
                  else
                  echo "file name $i"
                  fi
                  done





                  share|improve this answer




























                    2












                    2








                    2







                    If you don't have any files, then instead of printing * we can do this.



                    format=*.txt
                    for i in $format;
                    do
                    if [[ "$i" == "$format" ]]
                    then
                    echo "No Files"
                    else
                    echo "file name $i"
                    fi
                    done





                    share|improve this answer















                    If you don't have any files, then instead of printing * we can do this.



                    format=*.txt
                    for i in $format;
                    do
                    if [[ "$i" == "$format" ]]
                    then
                    echo "No Files"
                    else
                    echo "file name $i"
                    fi
                    done






                    share|improve this answer














                    share|improve this answer



                    share|improve this answer








                    edited Sep 26 '14 at 18:41

























                    answered Sep 24 '14 at 20:30









                    Mad-DMad-D

                    2,03673767




                    2,03673767























                        1














                        One more alternative using ls and sed:



                        $ ls -1 <dir> | sed -e 's/^/put /'


                        and using ls and xargs:



                        $ ls -1 <dir> | xargs -n1 -i%f echo 'put %f'





                        share|improve this answer


























                        • +1, but -1 is not needed and you can do sed -e 's/^/put /'

                          – William Pursell
                          Dec 15 '11 at 1:12











                        • @WilliamPursell Thanks, I've updated my response. Somehow, I misunderstood and made the braces and the dollar sign part of the solution. Also, I'ved another solution with xargs and echo, but the sed one is still more concise.

                          – jcollado
                          Dec 15 '11 at 6:05
















                        1














                        One more alternative using ls and sed:



                        $ ls -1 <dir> | sed -e 's/^/put /'


                        and using ls and xargs:



                        $ ls -1 <dir> | xargs -n1 -i%f echo 'put %f'





                        share|improve this answer


























                        • +1, but -1 is not needed and you can do sed -e 's/^/put /'

                          – William Pursell
                          Dec 15 '11 at 1:12











                        • @WilliamPursell Thanks, I've updated my response. Somehow, I misunderstood and made the braces and the dollar sign part of the solution. Also, I'ved another solution with xargs and echo, but the sed one is still more concise.

                          – jcollado
                          Dec 15 '11 at 6:05














                        1












                        1








                        1







                        One more alternative using ls and sed:



                        $ ls -1 <dir> | sed -e 's/^/put /'


                        and using ls and xargs:



                        $ ls -1 <dir> | xargs -n1 -i%f echo 'put %f'





                        share|improve this answer















                        One more alternative using ls and sed:



                        $ ls -1 <dir> | sed -e 's/^/put /'


                        and using ls and xargs:



                        $ ls -1 <dir> | xargs -n1 -i%f echo 'put %f'






                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited Dec 15 '11 at 6:02

























                        answered Dec 14 '11 at 22:21









                        jcolladojcollado

                        29.8k575118




                        29.8k575118













                        • +1, but -1 is not needed and you can do sed -e 's/^/put /'

                          – William Pursell
                          Dec 15 '11 at 1:12











                        • @WilliamPursell Thanks, I've updated my response. Somehow, I misunderstood and made the braces and the dollar sign part of the solution. Also, I'ved another solution with xargs and echo, but the sed one is still more concise.

                          – jcollado
                          Dec 15 '11 at 6:05



















                        • +1, but -1 is not needed and you can do sed -e 's/^/put /'

                          – William Pursell
                          Dec 15 '11 at 1:12











                        • @WilliamPursell Thanks, I've updated my response. Somehow, I misunderstood and made the braces and the dollar sign part of the solution. Also, I'ved another solution with xargs and echo, but the sed one is still more concise.

                          – jcollado
                          Dec 15 '11 at 6:05

















                        +1, but -1 is not needed and you can do sed -e 's/^/put /'

                        – William Pursell
                        Dec 15 '11 at 1:12





                        +1, but -1 is not needed and you can do sed -e 's/^/put /'

                        – William Pursell
                        Dec 15 '11 at 1:12













                        @WilliamPursell Thanks, I've updated my response. Somehow, I misunderstood and made the braces and the dollar sign part of the solution. Also, I'ved another solution with xargs and echo, but the sed one is still more concise.

                        – jcollado
                        Dec 15 '11 at 6:05





                        @WilliamPursell Thanks, I've updated my response. Somehow, I misunderstood and made the braces and the dollar sign part of the solution. Also, I'ved another solution with xargs and echo, but the sed one is still more concise.

                        – jcollado
                        Dec 15 '11 at 6:05











                        0














                        this will work also recursively if you have any sub directories and files inside them:



                        find . -type f|awk -F"/" '{print "put ",$NF}'





                        share|improve this answer




























                          0














                          this will work also recursively if you have any sub directories and files inside them:



                          find . -type f|awk -F"/" '{print "put ",$NF}'





                          share|improve this answer


























                            0












                            0








                            0







                            this will work also recursively if you have any sub directories and files inside them:



                            find . -type f|awk -F"/" '{print "put ",$NF}'





                            share|improve this answer













                            this will work also recursively if you have any sub directories and files inside them:



                            find . -type f|awk -F"/" '{print "put ",$NF}'






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Dec 15 '11 at 5:58









                            VijayVijay

                            32.5k75187296




                            32.5k75187296






























                                draft saved

                                draft discarded




















































                                Thanks for contributing an answer to Stack Overflow!


                                • 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%2fstackoverflow.com%2fquestions%2f8512462%2fshellscript-looping-through-all-files-in-a-folder%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

                                A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

                                Calculate evaluation metrics using cross_val_predict sklearn

                                Insert data from modal to MySQL (multiple modal on website)