How can I prepend filenames with ascending numbers like 1_ 2_?Bulk rename filesConcatenating several .mp3 files into one .mp3rename files with a shift in numbersHow to display line numbers with pygmentizeHow do I add zero padding to filenames that already have numbers in them?How to rename multiple files like in Windowsadding zero to specific location of file namesHelp with Bash script - appending sequential numbersHow to grep two numbers from the same line at different places using bash?How do I move numbers in filenames, in a batch renaming operation?How can I replace [0] with ascending numbers in a text file?

Calculate sum of polynomial roots

Why does a simple loop result in ASYNC_NETWORK_IO waits?

What features enable the Su-25 Frogfoot to operate with such a wide variety of fuels?

Temporarily disable WLAN internet access for children, but allow it for adults

Creepy dinosaur pc game identification

Why is so much work done on numerical verification of the Riemann Hypothesis?

How do you make your own symbol when Detexify fails?

What should you do if you miss a job interview (deliberately)?

Does malloc reserve more space while allocating memory?

PTIJ: Haman's bad computer

Why is the "ls" command showing permissions of files in a FAT32 partition?

Does IPv6 have similar concept of network mask?

How to explain what's wrong with this application of the chain rule?

What if a revenant (monster) gains fire resistance?

Can disgust be a key component of horror?

Plot of a tornado-shaped surface

What are the advantages of simplicial model categories over non-simplicial ones?

Why did the EU agree to delay the Brexit deadline?

Mimic lecturing on blackboard, facing audience

Open a doc from terminal, but not by its name

Are Captain Marvel's powers affected by Thanos' actions in Infinity War

Can a stoichiometric mixture of oxygen and methane exist as a liquid at standard pressure and some (low) temperature?

Lowest total scrabble score

Did arcade monitors have same pixel aspect ratio as TV sets?



How can I prepend filenames with ascending numbers like 1_ 2_?


Bulk rename filesConcatenating several .mp3 files into one .mp3rename files with a shift in numbersHow to display line numbers with pygmentizeHow do I add zero padding to filenames that already have numbers in them?How to rename multiple files like in Windowsadding zero to specific location of file namesHelp with Bash script - appending sequential numbersHow to grep two numbers from the same line at different places using bash?How do I move numbers in filenames, in a batch renaming operation?How can I replace [0] with ascending numbers in a text file?













6















How can I add numbers to the files in one directory?



In one directory I have files like below:



fileA
fileB
fileC
fileD


I want to prepend ascending numbers to them, like this:



1_fileA
2_fileB
3_fileC
4_fileD


Thank you in advance.










share|improve this question
























  • @PerlDuck Yes, I have to enumarte them changing their name.

    – paweljvn
    Nov 23 '18 at 17:53











  • Related: askubuntu.com/q/839959

    – Justin
    Nov 24 '18 at 5:25















6















How can I add numbers to the files in one directory?



In one directory I have files like below:



fileA
fileB
fileC
fileD


I want to prepend ascending numbers to them, like this:



1_fileA
2_fileB
3_fileC
4_fileD


Thank you in advance.










share|improve this question
























  • @PerlDuck Yes, I have to enumarte them changing their name.

    – paweljvn
    Nov 23 '18 at 17:53











  • Related: askubuntu.com/q/839959

    – Justin
    Nov 24 '18 at 5:25













6












6








6








How can I add numbers to the files in one directory?



In one directory I have files like below:



fileA
fileB
fileC
fileD


I want to prepend ascending numbers to them, like this:



1_fileA
2_fileB
3_fileC
4_fileD


Thank you in advance.










share|improve this question
















How can I add numbers to the files in one directory?



In one directory I have files like below:



fileA
fileB
fileC
fileD


I want to prepend ascending numbers to them, like this:



1_fileA
2_fileB
3_fileC
4_fileD


Thank you in advance.







command-line bash batch-rename






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 23 '18 at 18:54









Zanna

51.1k13138242




51.1k13138242










asked Nov 23 '18 at 17:50









paweljvnpaweljvn

516




516












  • @PerlDuck Yes, I have to enumarte them changing their name.

    – paweljvn
    Nov 23 '18 at 17:53











  • Related: askubuntu.com/q/839959

    – Justin
    Nov 24 '18 at 5:25

















  • @PerlDuck Yes, I have to enumarte them changing their name.

    – paweljvn
    Nov 23 '18 at 17:53











  • Related: askubuntu.com/q/839959

    – Justin
    Nov 24 '18 at 5:25
















@PerlDuck Yes, I have to enumarte them changing their name.

– paweljvn
Nov 23 '18 at 17:53





@PerlDuck Yes, I have to enumarte them changing their name.

– paweljvn
Nov 23 '18 at 17:53













Related: askubuntu.com/q/839959

– Justin
Nov 24 '18 at 5:25





Related: askubuntu.com/q/839959

– Justin
Nov 24 '18 at 5:25










6 Answers
6






active

oldest

votes


















8














One of the solutions:



cd <your dir> then run in bash (copy and paste in command-line):



n=1; for f in *; do mv "$f" "$((n++))_$f"; done


Bash script case:



#!/bin/bash
n=1
for f in *
do
if [ "$f" = "rename.sh" ]
then
continue
fi
mv "$f" "$((n++))_$f"
done


save it as rename.sh to dir with files to rename, chmod +x rename.sh then run it ./rename.sh






share|improve this answer

























  • but can I also run this from vim? I mean to put your code in vim as #!/bin/bash and the run it from the command line?

    – paweljvn
    Nov 23 '18 at 18:09











  • Sure. But you need add this simple command to bash file. Then You need to solve self-renaming of this rename.sh file.

    – mature
    Nov 23 '18 at 18:15






  • 1





    Added example with bash file. If you need something like bash command to run it in any file system place, you need use first example saved in bash file and add this bash file to PATH with alias.

    – mature
    Nov 23 '18 at 18:33


















7














If there are more than 9 files, I would use printf to pad the number to get the expected sort order, like this



n=0
for f in *
do printf -v new "%2d$((++n))_$f"
echo mv -v -- "$f" "$new"
done


Remove echo when you see the correct result.



Explanation



In this line, do printf -v new "%2d$((++n))_$f" we create a format for the new filenames and put it into the variable new.



%2d is a 2 digit decimal number. Instead of 2d, you can use 3d etc to get another leading 0 (if you have more than 99 files).



((++n)) increments the variable n (which we set to 0 at the start of the script). Since it is iterated once each time the loop is run, files get incremented name prefixes.



-v makes mv print what will be changed.



-- in the mv statement is to prevent filenames that start with - being interpreted as options.






share|improve this answer
































    6














    1. Open your directory in Nautilus.


    2. Highlight all of the files.


    3. Right-click, and select "Rename..." from the context menu.


    4. On the Rename dialog, click the +Add button.


    5. Select "1,2,3,4" under "Automatic Numbers"



    6. Then, in the Rename dialog, in the text entry field, insert an
      underscore "_" character between "[1, 2, 3]" and "[Original file name]".



      It should look like "[1, 2, 3]_[Original file name]"



    7. Click the Rename button.


    Select "1,2,3,4" in the Rename dialog



    The renamed files






    share|improve this answer






























      5
















      That’s a job for file-rename Install file-rename (aka perl rename):



      file-rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *


      This defines a variable, increases it if it’s not set (else it would start with 0 instead of 1) and replaces the beginning of the filename with the number increasing it every time. You can change the format easily, e.g. to make it three-digit (001, 002, …) use "%03d_". Running it with -n only prints the changes, to actually perform the renaming remove this flag.



      Example run



      $ ls -1
      fileA
      fileB
      fileC
      fileD
      $ rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
      rename(fileA, 1_fileA)
      rename(fileB, 2_fileB)
      rename(fileC, 3_fileC)
      rename(fileD, 4_fileD)
      $ rename 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
      $ ls -1
      1_fileA
      2_fileB
      3_fileC
      4_fileD





      share|improve this answer

























      • I highly recommend to use file-rename instead of rename. (assuming you intend to use File-Rename, packaged in the rename package.) On Ubuntu/Debian, the rename command is an alternative (/etc/alternatives/rename), so it could point to an incompatible binary, e.g. that from util-linux. For details, see bugs.debian.org/cgi-bin/bugreport.cgi?bug=735134#10.

        – myrdd
        6 hours ago












      • @myrdd I clarified that, the answer is about perl rename.

        – dessert
        1 hour ago











      • Okay, so I still recommend using the file-rename command. The rename package only conains the binaries /usr/bin/file-rename and /usr/bin/prename, see packages.ubuntu.com/bionic/all/rename/filelist

        – myrdd
        57 mins ago












      • @myrdd Now I finally got what you wanted to tell me! You’re right, thanks!

        – dessert
        42 mins ago



















      1














      One option is



      cd /path/to/folder/
      ls -1v | rename -n -v 's/^/sprintf("%02d_", ++our$i)/e'


      • This works fine, except with the file names with new line "n". Switch '-1v'takes care of spaces and tabs,


      • Other commands posted here change the order of files with numbers e.g. 10a comes before 1a.


      • Whichever suits in a situation.


      I had some time to test all these commands. Here are the results.



      $ ls
      001abc.txt '10a bc.txt' 1abc.txt '2ab c.txt' 'a'$'t''bc.txt'

      $ ls -1v | rename -n -v 's/^/sprintf("%02d_", ++our$i)/e'
      Reading filenames from file handle (GLOB(0x55cb57991b28))
      rename(001abc.txt, 01_001abc.txt)
      rename(1abc.txt, 02_1abc.txt)
      rename(2ab c.txt, 03_2ab c.txt)
      rename(10a bc.txt, 04_10a bc.txt)
      rename(a bc.txt, 05_a bc.txt)

      $ n=1; for f in *; do echo mv "$f" "$((n++))_$f"; done
      mv 001abc.txt 1_001abc.txt
      mv 10a bc.txt 2_10a bc.txt
      mv 1abc.txt 3_1abc.txt
      mv 2ab c.txt 4_2ab c.txt
      mv a bc.txt 5_a bc.txt

      $ for f in *; do printf -v new "%2d$((++n))_$f"; echo mv -v -- "$f" "$new"; done
      mv -v -- 001abc.txt 09_001abc.txt
      mv -v -- 10a bc.txt 010_10a bc.txt
      mv -v -- 1abc.txt 011_1abc.txt
      mv -v -- 2ab c.txt 012_2ab c.txt
      mv -v -- a bc.txt 013_a bc.txt

      $ ./rename.sh
      mv 001abc.txt 1_001abc.txt
      mv 10a bc.txt 2_10a bc.txt
      mv 1abc.txt 3_1abc.txt
      mv 2ab c.txt 4_2ab c.txt
      mv a bc.txt 5_a bc.txt

      $ rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
      rename(001abc.txt, 1_001abc.txt)
      rename(10a bc.txt, 2_10a bc.txt)
      rename(1abc.txt, 3_1abc.txt)
      rename(2ab c.txt, 4_2ab c.txt)
      rename(a bc.txt, 5_a bc.txt)
      rename(rename.sh, 6_rename.sh)

      $ for f in *; do printf -v new "%2d$((++n))_$f"; echo mv -v -- "$f" "$new"; done
      mv -v -- 001abc.txt 01_001abc.txt
      mv -v -- 10a bc.txt 02_10a bc.txt
      mv -v -- 1abc.txt 03_1abc.txt
      mv -v -- 2ab c.txt 04_2ab c.txt
      mv -v -- a bc.txt 05_a bc.txt
      mv -v -- rename.sh 06_rename.sh





      share|improve this answer
































        -2














        pyrenamer is also a dead easy solution






        share|improve this answer























        • Please don't just post some tool as an answer. Demonstrate how it solves the problem in the answer.

          – Melebius
          Nov 27 '18 at 8:25










        Your Answer








        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "89"
        ;
        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%2faskubuntu.com%2fquestions%2f1095456%2fhow-can-i-prepend-filenames-with-ascending-numbers-like-1-2%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









        8














        One of the solutions:



        cd <your dir> then run in bash (copy and paste in command-line):



        n=1; for f in *; do mv "$f" "$((n++))_$f"; done


        Bash script case:



        #!/bin/bash
        n=1
        for f in *
        do
        if [ "$f" = "rename.sh" ]
        then
        continue
        fi
        mv "$f" "$((n++))_$f"
        done


        save it as rename.sh to dir with files to rename, chmod +x rename.sh then run it ./rename.sh






        share|improve this answer

























        • but can I also run this from vim? I mean to put your code in vim as #!/bin/bash and the run it from the command line?

          – paweljvn
          Nov 23 '18 at 18:09











        • Sure. But you need add this simple command to bash file. Then You need to solve self-renaming of this rename.sh file.

          – mature
          Nov 23 '18 at 18:15






        • 1





          Added example with bash file. If you need something like bash command to run it in any file system place, you need use first example saved in bash file and add this bash file to PATH with alias.

          – mature
          Nov 23 '18 at 18:33















        8














        One of the solutions:



        cd <your dir> then run in bash (copy and paste in command-line):



        n=1; for f in *; do mv "$f" "$((n++))_$f"; done


        Bash script case:



        #!/bin/bash
        n=1
        for f in *
        do
        if [ "$f" = "rename.sh" ]
        then
        continue
        fi
        mv "$f" "$((n++))_$f"
        done


        save it as rename.sh to dir with files to rename, chmod +x rename.sh then run it ./rename.sh






        share|improve this answer

























        • but can I also run this from vim? I mean to put your code in vim as #!/bin/bash and the run it from the command line?

          – paweljvn
          Nov 23 '18 at 18:09











        • Sure. But you need add this simple command to bash file. Then You need to solve self-renaming of this rename.sh file.

          – mature
          Nov 23 '18 at 18:15






        • 1





          Added example with bash file. If you need something like bash command to run it in any file system place, you need use first example saved in bash file and add this bash file to PATH with alias.

          – mature
          Nov 23 '18 at 18:33













        8












        8








        8







        One of the solutions:



        cd <your dir> then run in bash (copy and paste in command-line):



        n=1; for f in *; do mv "$f" "$((n++))_$f"; done


        Bash script case:



        #!/bin/bash
        n=1
        for f in *
        do
        if [ "$f" = "rename.sh" ]
        then
        continue
        fi
        mv "$f" "$((n++))_$f"
        done


        save it as rename.sh to dir with files to rename, chmod +x rename.sh then run it ./rename.sh






        share|improve this answer















        One of the solutions:



        cd <your dir> then run in bash (copy and paste in command-line):



        n=1; for f in *; do mv "$f" "$((n++))_$f"; done


        Bash script case:



        #!/bin/bash
        n=1
        for f in *
        do
        if [ "$f" = "rename.sh" ]
        then
        continue
        fi
        mv "$f" "$((n++))_$f"
        done


        save it as rename.sh to dir with files to rename, chmod +x rename.sh then run it ./rename.sh







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Nov 23 '18 at 18:30

























        answered Nov 23 '18 at 18:02









        maturemature

        2,1574931




        2,1574931












        • but can I also run this from vim? I mean to put your code in vim as #!/bin/bash and the run it from the command line?

          – paweljvn
          Nov 23 '18 at 18:09











        • Sure. But you need add this simple command to bash file. Then You need to solve self-renaming of this rename.sh file.

          – mature
          Nov 23 '18 at 18:15






        • 1





          Added example with bash file. If you need something like bash command to run it in any file system place, you need use first example saved in bash file and add this bash file to PATH with alias.

          – mature
          Nov 23 '18 at 18:33

















        • but can I also run this from vim? I mean to put your code in vim as #!/bin/bash and the run it from the command line?

          – paweljvn
          Nov 23 '18 at 18:09











        • Sure. But you need add this simple command to bash file. Then You need to solve self-renaming of this rename.sh file.

          – mature
          Nov 23 '18 at 18:15






        • 1





          Added example with bash file. If you need something like bash command to run it in any file system place, you need use first example saved in bash file and add this bash file to PATH with alias.

          – mature
          Nov 23 '18 at 18:33
















        but can I also run this from vim? I mean to put your code in vim as #!/bin/bash and the run it from the command line?

        – paweljvn
        Nov 23 '18 at 18:09





        but can I also run this from vim? I mean to put your code in vim as #!/bin/bash and the run it from the command line?

        – paweljvn
        Nov 23 '18 at 18:09













        Sure. But you need add this simple command to bash file. Then You need to solve self-renaming of this rename.sh file.

        – mature
        Nov 23 '18 at 18:15





        Sure. But you need add this simple command to bash file. Then You need to solve self-renaming of this rename.sh file.

        – mature
        Nov 23 '18 at 18:15




        1




        1





        Added example with bash file. If you need something like bash command to run it in any file system place, you need use first example saved in bash file and add this bash file to PATH with alias.

        – mature
        Nov 23 '18 at 18:33





        Added example with bash file. If you need something like bash command to run it in any file system place, you need use first example saved in bash file and add this bash file to PATH with alias.

        – mature
        Nov 23 '18 at 18:33













        7














        If there are more than 9 files, I would use printf to pad the number to get the expected sort order, like this



        n=0
        for f in *
        do printf -v new "%2d$((++n))_$f"
        echo mv -v -- "$f" "$new"
        done


        Remove echo when you see the correct result.



        Explanation



        In this line, do printf -v new "%2d$((++n))_$f" we create a format for the new filenames and put it into the variable new.



        %2d is a 2 digit decimal number. Instead of 2d, you can use 3d etc to get another leading 0 (if you have more than 99 files).



        ((++n)) increments the variable n (which we set to 0 at the start of the script). Since it is iterated once each time the loop is run, files get incremented name prefixes.



        -v makes mv print what will be changed.



        -- in the mv statement is to prevent filenames that start with - being interpreted as options.






        share|improve this answer





























          7














          If there are more than 9 files, I would use printf to pad the number to get the expected sort order, like this



          n=0
          for f in *
          do printf -v new "%2d$((++n))_$f"
          echo mv -v -- "$f" "$new"
          done


          Remove echo when you see the correct result.



          Explanation



          In this line, do printf -v new "%2d$((++n))_$f" we create a format for the new filenames and put it into the variable new.



          %2d is a 2 digit decimal number. Instead of 2d, you can use 3d etc to get another leading 0 (if you have more than 99 files).



          ((++n)) increments the variable n (which we set to 0 at the start of the script). Since it is iterated once each time the loop is run, files get incremented name prefixes.



          -v makes mv print what will be changed.



          -- in the mv statement is to prevent filenames that start with - being interpreted as options.






          share|improve this answer



























            7












            7








            7







            If there are more than 9 files, I would use printf to pad the number to get the expected sort order, like this



            n=0
            for f in *
            do printf -v new "%2d$((++n))_$f"
            echo mv -v -- "$f" "$new"
            done


            Remove echo when you see the correct result.



            Explanation



            In this line, do printf -v new "%2d$((++n))_$f" we create a format for the new filenames and put it into the variable new.



            %2d is a 2 digit decimal number. Instead of 2d, you can use 3d etc to get another leading 0 (if you have more than 99 files).



            ((++n)) increments the variable n (which we set to 0 at the start of the script). Since it is iterated once each time the loop is run, files get incremented name prefixes.



            -v makes mv print what will be changed.



            -- in the mv statement is to prevent filenames that start with - being interpreted as options.






            share|improve this answer















            If there are more than 9 files, I would use printf to pad the number to get the expected sort order, like this



            n=0
            for f in *
            do printf -v new "%2d$((++n))_$f"
            echo mv -v -- "$f" "$new"
            done


            Remove echo when you see the correct result.



            Explanation



            In this line, do printf -v new "%2d$((++n))_$f" we create a format for the new filenames and put it into the variable new.



            %2d is a 2 digit decimal number. Instead of 2d, you can use 3d etc to get another leading 0 (if you have more than 99 files).



            ((++n)) increments the variable n (which we set to 0 at the start of the script). Since it is iterated once each time the loop is run, files get incremented name prefixes.



            -v makes mv print what will be changed.



            -- in the mv statement is to prevent filenames that start with - being interpreted as options.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Nov 26 '18 at 21:24

























            answered Nov 23 '18 at 19:05









            ZannaZanna

            51.1k13138242




            51.1k13138242





















                6














                1. Open your directory in Nautilus.


                2. Highlight all of the files.


                3. Right-click, and select "Rename..." from the context menu.


                4. On the Rename dialog, click the +Add button.


                5. Select "1,2,3,4" under "Automatic Numbers"



                6. Then, in the Rename dialog, in the text entry field, insert an
                  underscore "_" character between "[1, 2, 3]" and "[Original file name]".



                  It should look like "[1, 2, 3]_[Original file name]"



                7. Click the Rename button.


                Select "1,2,3,4" in the Rename dialog



                The renamed files






                share|improve this answer



























                  6














                  1. Open your directory in Nautilus.


                  2. Highlight all of the files.


                  3. Right-click, and select "Rename..." from the context menu.


                  4. On the Rename dialog, click the +Add button.


                  5. Select "1,2,3,4" under "Automatic Numbers"



                  6. Then, in the Rename dialog, in the text entry field, insert an
                    underscore "_" character between "[1, 2, 3]" and "[Original file name]".



                    It should look like "[1, 2, 3]_[Original file name]"



                  7. Click the Rename button.


                  Select "1,2,3,4" in the Rename dialog



                  The renamed files






                  share|improve this answer

























                    6












                    6








                    6







                    1. Open your directory in Nautilus.


                    2. Highlight all of the files.


                    3. Right-click, and select "Rename..." from the context menu.


                    4. On the Rename dialog, click the +Add button.


                    5. Select "1,2,3,4" under "Automatic Numbers"



                    6. Then, in the Rename dialog, in the text entry field, insert an
                      underscore "_" character between "[1, 2, 3]" and "[Original file name]".



                      It should look like "[1, 2, 3]_[Original file name]"



                    7. Click the Rename button.


                    Select "1,2,3,4" in the Rename dialog



                    The renamed files






                    share|improve this answer













                    1. Open your directory in Nautilus.


                    2. Highlight all of the files.


                    3. Right-click, and select "Rename..." from the context menu.


                    4. On the Rename dialog, click the +Add button.


                    5. Select "1,2,3,4" under "Automatic Numbers"



                    6. Then, in the Rename dialog, in the text entry field, insert an
                      underscore "_" character between "[1, 2, 3]" and "[Original file name]".



                      It should look like "[1, 2, 3]_[Original file name]"



                    7. Click the Rename button.


                    Select "1,2,3,4" in the Rename dialog



                    The renamed files







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Nov 26 '18 at 22:13









                    PJ SinghPJ Singh

                    4,46232551




                    4,46232551





















                        5
















                        That’s a job for file-rename Install file-rename (aka perl rename):



                        file-rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *


                        This defines a variable, increases it if it’s not set (else it would start with 0 instead of 1) and replaces the beginning of the filename with the number increasing it every time. You can change the format easily, e.g. to make it three-digit (001, 002, …) use "%03d_". Running it with -n only prints the changes, to actually perform the renaming remove this flag.



                        Example run



                        $ ls -1
                        fileA
                        fileB
                        fileC
                        fileD
                        $ rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
                        rename(fileA, 1_fileA)
                        rename(fileB, 2_fileB)
                        rename(fileC, 3_fileC)
                        rename(fileD, 4_fileD)
                        $ rename 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
                        $ ls -1
                        1_fileA
                        2_fileB
                        3_fileC
                        4_fileD





                        share|improve this answer

























                        • I highly recommend to use file-rename instead of rename. (assuming you intend to use File-Rename, packaged in the rename package.) On Ubuntu/Debian, the rename command is an alternative (/etc/alternatives/rename), so it could point to an incompatible binary, e.g. that from util-linux. For details, see bugs.debian.org/cgi-bin/bugreport.cgi?bug=735134#10.

                          – myrdd
                          6 hours ago












                        • @myrdd I clarified that, the answer is about perl rename.

                          – dessert
                          1 hour ago











                        • Okay, so I still recommend using the file-rename command. The rename package only conains the binaries /usr/bin/file-rename and /usr/bin/prename, see packages.ubuntu.com/bionic/all/rename/filelist

                          – myrdd
                          57 mins ago












                        • @myrdd Now I finally got what you wanted to tell me! You’re right, thanks!

                          – dessert
                          42 mins ago
















                        5
















                        That’s a job for file-rename Install file-rename (aka perl rename):



                        file-rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *


                        This defines a variable, increases it if it’s not set (else it would start with 0 instead of 1) and replaces the beginning of the filename with the number increasing it every time. You can change the format easily, e.g. to make it three-digit (001, 002, …) use "%03d_". Running it with -n only prints the changes, to actually perform the renaming remove this flag.



                        Example run



                        $ ls -1
                        fileA
                        fileB
                        fileC
                        fileD
                        $ rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
                        rename(fileA, 1_fileA)
                        rename(fileB, 2_fileB)
                        rename(fileC, 3_fileC)
                        rename(fileD, 4_fileD)
                        $ rename 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
                        $ ls -1
                        1_fileA
                        2_fileB
                        3_fileC
                        4_fileD





                        share|improve this answer

























                        • I highly recommend to use file-rename instead of rename. (assuming you intend to use File-Rename, packaged in the rename package.) On Ubuntu/Debian, the rename command is an alternative (/etc/alternatives/rename), so it could point to an incompatible binary, e.g. that from util-linux. For details, see bugs.debian.org/cgi-bin/bugreport.cgi?bug=735134#10.

                          – myrdd
                          6 hours ago












                        • @myrdd I clarified that, the answer is about perl rename.

                          – dessert
                          1 hour ago











                        • Okay, so I still recommend using the file-rename command. The rename package only conains the binaries /usr/bin/file-rename and /usr/bin/prename, see packages.ubuntu.com/bionic/all/rename/filelist

                          – myrdd
                          57 mins ago












                        • @myrdd Now I finally got what you wanted to tell me! You’re right, thanks!

                          – dessert
                          42 mins ago














                        5












                        5








                        5









                        That’s a job for file-rename Install file-rename (aka perl rename):



                        file-rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *


                        This defines a variable, increases it if it’s not set (else it would start with 0 instead of 1) and replaces the beginning of the filename with the number increasing it every time. You can change the format easily, e.g. to make it three-digit (001, 002, …) use "%03d_". Running it with -n only prints the changes, to actually perform the renaming remove this flag.



                        Example run



                        $ ls -1
                        fileA
                        fileB
                        fileC
                        fileD
                        $ rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
                        rename(fileA, 1_fileA)
                        rename(fileB, 2_fileB)
                        rename(fileC, 3_fileC)
                        rename(fileD, 4_fileD)
                        $ rename 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
                        $ ls -1
                        1_fileA
                        2_fileB
                        3_fileC
                        4_fileD





                        share|improve this answer

















                        That’s a job for file-rename Install file-rename (aka perl rename):



                        file-rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *


                        This defines a variable, increases it if it’s not set (else it would start with 0 instead of 1) and replaces the beginning of the filename with the number increasing it every time. You can change the format easily, e.g. to make it three-digit (001, 002, …) use "%03d_". Running it with -n only prints the changes, to actually perform the renaming remove this flag.



                        Example run



                        $ ls -1
                        fileA
                        fileB
                        fileC
                        fileD
                        $ rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
                        rename(fileA, 1_fileA)
                        rename(fileB, 2_fileB)
                        rename(fileC, 3_fileC)
                        rename(fileD, 4_fileD)
                        $ rename 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
                        $ ls -1
                        1_fileA
                        2_fileB
                        3_fileC
                        4_fileD






                        share|improve this answer














                        share|improve this answer



                        share|improve this answer








                        edited 44 mins ago

























                        answered Nov 23 '18 at 20:27









                        dessertdessert

                        24.8k672105




                        24.8k672105












                        • I highly recommend to use file-rename instead of rename. (assuming you intend to use File-Rename, packaged in the rename package.) On Ubuntu/Debian, the rename command is an alternative (/etc/alternatives/rename), so it could point to an incompatible binary, e.g. that from util-linux. For details, see bugs.debian.org/cgi-bin/bugreport.cgi?bug=735134#10.

                          – myrdd
                          6 hours ago












                        • @myrdd I clarified that, the answer is about perl rename.

                          – dessert
                          1 hour ago











                        • Okay, so I still recommend using the file-rename command. The rename package only conains the binaries /usr/bin/file-rename and /usr/bin/prename, see packages.ubuntu.com/bionic/all/rename/filelist

                          – myrdd
                          57 mins ago












                        • @myrdd Now I finally got what you wanted to tell me! You’re right, thanks!

                          – dessert
                          42 mins ago


















                        • I highly recommend to use file-rename instead of rename. (assuming you intend to use File-Rename, packaged in the rename package.) On Ubuntu/Debian, the rename command is an alternative (/etc/alternatives/rename), so it could point to an incompatible binary, e.g. that from util-linux. For details, see bugs.debian.org/cgi-bin/bugreport.cgi?bug=735134#10.

                          – myrdd
                          6 hours ago












                        • @myrdd I clarified that, the answer is about perl rename.

                          – dessert
                          1 hour ago











                        • Okay, so I still recommend using the file-rename command. The rename package only conains the binaries /usr/bin/file-rename and /usr/bin/prename, see packages.ubuntu.com/bionic/all/rename/filelist

                          – myrdd
                          57 mins ago












                        • @myrdd Now I finally got what you wanted to tell me! You’re right, thanks!

                          – dessert
                          42 mins ago

















                        I highly recommend to use file-rename instead of rename. (assuming you intend to use File-Rename, packaged in the rename package.) On Ubuntu/Debian, the rename command is an alternative (/etc/alternatives/rename), so it could point to an incompatible binary, e.g. that from util-linux. For details, see bugs.debian.org/cgi-bin/bugreport.cgi?bug=735134#10.

                        – myrdd
                        6 hours ago






                        I highly recommend to use file-rename instead of rename. (assuming you intend to use File-Rename, packaged in the rename package.) On Ubuntu/Debian, the rename command is an alternative (/etc/alternatives/rename), so it could point to an incompatible binary, e.g. that from util-linux. For details, see bugs.debian.org/cgi-bin/bugreport.cgi?bug=735134#10.

                        – myrdd
                        6 hours ago














                        @myrdd I clarified that, the answer is about perl rename.

                        – dessert
                        1 hour ago





                        @myrdd I clarified that, the answer is about perl rename.

                        – dessert
                        1 hour ago













                        Okay, so I still recommend using the file-rename command. The rename package only conains the binaries /usr/bin/file-rename and /usr/bin/prename, see packages.ubuntu.com/bionic/all/rename/filelist

                        – myrdd
                        57 mins ago






                        Okay, so I still recommend using the file-rename command. The rename package only conains the binaries /usr/bin/file-rename and /usr/bin/prename, see packages.ubuntu.com/bionic/all/rename/filelist

                        – myrdd
                        57 mins ago














                        @myrdd Now I finally got what you wanted to tell me! You’re right, thanks!

                        – dessert
                        42 mins ago






                        @myrdd Now I finally got what you wanted to tell me! You’re right, thanks!

                        – dessert
                        42 mins ago












                        1














                        One option is



                        cd /path/to/folder/
                        ls -1v | rename -n -v 's/^/sprintf("%02d_", ++our$i)/e'


                        • This works fine, except with the file names with new line "n". Switch '-1v'takes care of spaces and tabs,


                        • Other commands posted here change the order of files with numbers e.g. 10a comes before 1a.


                        • Whichever suits in a situation.


                        I had some time to test all these commands. Here are the results.



                        $ ls
                        001abc.txt '10a bc.txt' 1abc.txt '2ab c.txt' 'a'$'t''bc.txt'

                        $ ls -1v | rename -n -v 's/^/sprintf("%02d_", ++our$i)/e'
                        Reading filenames from file handle (GLOB(0x55cb57991b28))
                        rename(001abc.txt, 01_001abc.txt)
                        rename(1abc.txt, 02_1abc.txt)
                        rename(2ab c.txt, 03_2ab c.txt)
                        rename(10a bc.txt, 04_10a bc.txt)
                        rename(a bc.txt, 05_a bc.txt)

                        $ n=1; for f in *; do echo mv "$f" "$((n++))_$f"; done
                        mv 001abc.txt 1_001abc.txt
                        mv 10a bc.txt 2_10a bc.txt
                        mv 1abc.txt 3_1abc.txt
                        mv 2ab c.txt 4_2ab c.txt
                        mv a bc.txt 5_a bc.txt

                        $ for f in *; do printf -v new "%2d$((++n))_$f"; echo mv -v -- "$f" "$new"; done
                        mv -v -- 001abc.txt 09_001abc.txt
                        mv -v -- 10a bc.txt 010_10a bc.txt
                        mv -v -- 1abc.txt 011_1abc.txt
                        mv -v -- 2ab c.txt 012_2ab c.txt
                        mv -v -- a bc.txt 013_a bc.txt

                        $ ./rename.sh
                        mv 001abc.txt 1_001abc.txt
                        mv 10a bc.txt 2_10a bc.txt
                        mv 1abc.txt 3_1abc.txt
                        mv 2ab c.txt 4_2ab c.txt
                        mv a bc.txt 5_a bc.txt

                        $ rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
                        rename(001abc.txt, 1_001abc.txt)
                        rename(10a bc.txt, 2_10a bc.txt)
                        rename(1abc.txt, 3_1abc.txt)
                        rename(2ab c.txt, 4_2ab c.txt)
                        rename(a bc.txt, 5_a bc.txt)
                        rename(rename.sh, 6_rename.sh)

                        $ for f in *; do printf -v new "%2d$((++n))_$f"; echo mv -v -- "$f" "$new"; done
                        mv -v -- 001abc.txt 01_001abc.txt
                        mv -v -- 10a bc.txt 02_10a bc.txt
                        mv -v -- 1abc.txt 03_1abc.txt
                        mv -v -- 2ab c.txt 04_2ab c.txt
                        mv -v -- a bc.txt 05_a bc.txt
                        mv -v -- rename.sh 06_rename.sh





                        share|improve this answer





























                          1














                          One option is



                          cd /path/to/folder/
                          ls -1v | rename -n -v 's/^/sprintf("%02d_", ++our$i)/e'


                          • This works fine, except with the file names with new line "n". Switch '-1v'takes care of spaces and tabs,


                          • Other commands posted here change the order of files with numbers e.g. 10a comes before 1a.


                          • Whichever suits in a situation.


                          I had some time to test all these commands. Here are the results.



                          $ ls
                          001abc.txt '10a bc.txt' 1abc.txt '2ab c.txt' 'a'$'t''bc.txt'

                          $ ls -1v | rename -n -v 's/^/sprintf("%02d_", ++our$i)/e'
                          Reading filenames from file handle (GLOB(0x55cb57991b28))
                          rename(001abc.txt, 01_001abc.txt)
                          rename(1abc.txt, 02_1abc.txt)
                          rename(2ab c.txt, 03_2ab c.txt)
                          rename(10a bc.txt, 04_10a bc.txt)
                          rename(a bc.txt, 05_a bc.txt)

                          $ n=1; for f in *; do echo mv "$f" "$((n++))_$f"; done
                          mv 001abc.txt 1_001abc.txt
                          mv 10a bc.txt 2_10a bc.txt
                          mv 1abc.txt 3_1abc.txt
                          mv 2ab c.txt 4_2ab c.txt
                          mv a bc.txt 5_a bc.txt

                          $ for f in *; do printf -v new "%2d$((++n))_$f"; echo mv -v -- "$f" "$new"; done
                          mv -v -- 001abc.txt 09_001abc.txt
                          mv -v -- 10a bc.txt 010_10a bc.txt
                          mv -v -- 1abc.txt 011_1abc.txt
                          mv -v -- 2ab c.txt 012_2ab c.txt
                          mv -v -- a bc.txt 013_a bc.txt

                          $ ./rename.sh
                          mv 001abc.txt 1_001abc.txt
                          mv 10a bc.txt 2_10a bc.txt
                          mv 1abc.txt 3_1abc.txt
                          mv 2ab c.txt 4_2ab c.txt
                          mv a bc.txt 5_a bc.txt

                          $ rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
                          rename(001abc.txt, 1_001abc.txt)
                          rename(10a bc.txt, 2_10a bc.txt)
                          rename(1abc.txt, 3_1abc.txt)
                          rename(2ab c.txt, 4_2ab c.txt)
                          rename(a bc.txt, 5_a bc.txt)
                          rename(rename.sh, 6_rename.sh)

                          $ for f in *; do printf -v new "%2d$((++n))_$f"; echo mv -v -- "$f" "$new"; done
                          mv -v -- 001abc.txt 01_001abc.txt
                          mv -v -- 10a bc.txt 02_10a bc.txt
                          mv -v -- 1abc.txt 03_1abc.txt
                          mv -v -- 2ab c.txt 04_2ab c.txt
                          mv -v -- a bc.txt 05_a bc.txt
                          mv -v -- rename.sh 06_rename.sh





                          share|improve this answer



























                            1












                            1








                            1







                            One option is



                            cd /path/to/folder/
                            ls -1v | rename -n -v 's/^/sprintf("%02d_", ++our$i)/e'


                            • This works fine, except with the file names with new line "n". Switch '-1v'takes care of spaces and tabs,


                            • Other commands posted here change the order of files with numbers e.g. 10a comes before 1a.


                            • Whichever suits in a situation.


                            I had some time to test all these commands. Here are the results.



                            $ ls
                            001abc.txt '10a bc.txt' 1abc.txt '2ab c.txt' 'a'$'t''bc.txt'

                            $ ls -1v | rename -n -v 's/^/sprintf("%02d_", ++our$i)/e'
                            Reading filenames from file handle (GLOB(0x55cb57991b28))
                            rename(001abc.txt, 01_001abc.txt)
                            rename(1abc.txt, 02_1abc.txt)
                            rename(2ab c.txt, 03_2ab c.txt)
                            rename(10a bc.txt, 04_10a bc.txt)
                            rename(a bc.txt, 05_a bc.txt)

                            $ n=1; for f in *; do echo mv "$f" "$((n++))_$f"; done
                            mv 001abc.txt 1_001abc.txt
                            mv 10a bc.txt 2_10a bc.txt
                            mv 1abc.txt 3_1abc.txt
                            mv 2ab c.txt 4_2ab c.txt
                            mv a bc.txt 5_a bc.txt

                            $ for f in *; do printf -v new "%2d$((++n))_$f"; echo mv -v -- "$f" "$new"; done
                            mv -v -- 001abc.txt 09_001abc.txt
                            mv -v -- 10a bc.txt 010_10a bc.txt
                            mv -v -- 1abc.txt 011_1abc.txt
                            mv -v -- 2ab c.txt 012_2ab c.txt
                            mv -v -- a bc.txt 013_a bc.txt

                            $ ./rename.sh
                            mv 001abc.txt 1_001abc.txt
                            mv 10a bc.txt 2_10a bc.txt
                            mv 1abc.txt 3_1abc.txt
                            mv 2ab c.txt 4_2ab c.txt
                            mv a bc.txt 5_a bc.txt

                            $ rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
                            rename(001abc.txt, 1_001abc.txt)
                            rename(10a bc.txt, 2_10a bc.txt)
                            rename(1abc.txt, 3_1abc.txt)
                            rename(2ab c.txt, 4_2ab c.txt)
                            rename(a bc.txt, 5_a bc.txt)
                            rename(rename.sh, 6_rename.sh)

                            $ for f in *; do printf -v new "%2d$((++n))_$f"; echo mv -v -- "$f" "$new"; done
                            mv -v -- 001abc.txt 01_001abc.txt
                            mv -v -- 10a bc.txt 02_10a bc.txt
                            mv -v -- 1abc.txt 03_1abc.txt
                            mv -v -- 2ab c.txt 04_2ab c.txt
                            mv -v -- a bc.txt 05_a bc.txt
                            mv -v -- rename.sh 06_rename.sh





                            share|improve this answer















                            One option is



                            cd /path/to/folder/
                            ls -1v | rename -n -v 's/^/sprintf("%02d_", ++our$i)/e'


                            • This works fine, except with the file names with new line "n". Switch '-1v'takes care of spaces and tabs,


                            • Other commands posted here change the order of files with numbers e.g. 10a comes before 1a.


                            • Whichever suits in a situation.


                            I had some time to test all these commands. Here are the results.



                            $ ls
                            001abc.txt '10a bc.txt' 1abc.txt '2ab c.txt' 'a'$'t''bc.txt'

                            $ ls -1v | rename -n -v 's/^/sprintf("%02d_", ++our$i)/e'
                            Reading filenames from file handle (GLOB(0x55cb57991b28))
                            rename(001abc.txt, 01_001abc.txt)
                            rename(1abc.txt, 02_1abc.txt)
                            rename(2ab c.txt, 03_2ab c.txt)
                            rename(10a bc.txt, 04_10a bc.txt)
                            rename(a bc.txt, 05_a bc.txt)

                            $ n=1; for f in *; do echo mv "$f" "$((n++))_$f"; done
                            mv 001abc.txt 1_001abc.txt
                            mv 10a bc.txt 2_10a bc.txt
                            mv 1abc.txt 3_1abc.txt
                            mv 2ab c.txt 4_2ab c.txt
                            mv a bc.txt 5_a bc.txt

                            $ for f in *; do printf -v new "%2d$((++n))_$f"; echo mv -v -- "$f" "$new"; done
                            mv -v -- 001abc.txt 09_001abc.txt
                            mv -v -- 10a bc.txt 010_10a bc.txt
                            mv -v -- 1abc.txt 011_1abc.txt
                            mv -v -- 2ab c.txt 012_2ab c.txt
                            mv -v -- a bc.txt 013_a bc.txt

                            $ ./rename.sh
                            mv 001abc.txt 1_001abc.txt
                            mv 10a bc.txt 2_10a bc.txt
                            mv 1abc.txt 3_1abc.txt
                            mv 2ab c.txt 4_2ab c.txt
                            mv a bc.txt 5_a bc.txt

                            $ rename -n 'our $i; if (!$i) $i++; s/^/sprintf("%d_", $i++)/e' *
                            rename(001abc.txt, 1_001abc.txt)
                            rename(10a bc.txt, 2_10a bc.txt)
                            rename(1abc.txt, 3_1abc.txt)
                            rename(2ab c.txt, 4_2ab c.txt)
                            rename(a bc.txt, 5_a bc.txt)
                            rename(rename.sh, 6_rename.sh)

                            $ for f in *; do printf -v new "%2d$((++n))_$f"; echo mv -v -- "$f" "$new"; done
                            mv -v -- 001abc.txt 01_001abc.txt
                            mv -v -- 10a bc.txt 02_10a bc.txt
                            mv -v -- 1abc.txt 03_1abc.txt
                            mv -v -- 2ab c.txt 04_2ab c.txt
                            mv -v -- a bc.txt 05_a bc.txt
                            mv -v -- rename.sh 06_rename.sh






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Nov 24 '18 at 14:43

























                            answered Nov 24 '18 at 13:55









                            VijayVijay

                            1,8601720




                            1,8601720





















                                -2














                                pyrenamer is also a dead easy solution






                                share|improve this answer























                                • Please don't just post some tool as an answer. Demonstrate how it solves the problem in the answer.

                                  – Melebius
                                  Nov 27 '18 at 8:25















                                -2














                                pyrenamer is also a dead easy solution






                                share|improve this answer























                                • Please don't just post some tool as an answer. Demonstrate how it solves the problem in the answer.

                                  – Melebius
                                  Nov 27 '18 at 8:25













                                -2












                                -2








                                -2







                                pyrenamer is also a dead easy solution






                                share|improve this answer













                                pyrenamer is also a dead easy solution







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Nov 26 '18 at 22:42









                                Carol McAnultyCarol McAnulty

                                472




                                472












                                • Please don't just post some tool as an answer. Demonstrate how it solves the problem in the answer.

                                  – Melebius
                                  Nov 27 '18 at 8:25

















                                • Please don't just post some tool as an answer. Demonstrate how it solves the problem in the answer.

                                  – Melebius
                                  Nov 27 '18 at 8:25
















                                Please don't just post some tool as an answer. Demonstrate how it solves the problem in the answer.

                                – Melebius
                                Nov 27 '18 at 8:25





                                Please don't just post some tool as an answer. Demonstrate how it solves the problem in the answer.

                                – Melebius
                                Nov 27 '18 at 8:25

















                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Ask Ubuntu!


                                • 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%2faskubuntu.com%2fquestions%2f1095456%2fhow-can-i-prepend-filenames-with-ascending-numbers-like-1-2%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

                                Are there any comparative studies done between Ashtavakra Gita and Buddhim?How is it wrong to believe that a self exists, or that it doesn't?Can you criticise or improve Ven. Bodhi's description of MahayanaWas the doctrine of 'Anatta', accepted as doctrine by modern Buddhism, actually taught by the Buddha?Relationship between Buddhism, Hinduism and Yoga?Comparison of Nirvana, Tao and Brahman/AtmaIs there a distinction between “ego identity” and “craving/hating”?Are there many differences between Taoism and Buddhism?Loss of “faith” in buddhismSimilarity between creation in Abrahamic religions and beginning of life in Earth mentioned Agganna Sutta?Are there studies about the difference between meditating in the morning versus in the evening?Can one follow Hinduism and Buddhism at the same time?Are there any prohibitions on participating in other religion's practices?Psychology of 'flow'

                                Where else does the Shulchan Aruch quote an authority by name?Parashat Metzora+HagadolPesach/PassoverShulchan Aruch UTF-8Anonymous glosses in the Shulchan AruchWhy is the Shulchan Aruch definitive?Siman 32, Kitzur Shulchan Aruch: UntranslatedLitvaks/Yeshivish and Shulchan AruchBuying a Shulchan AruchEnglish version of SHULCHAN ARUCHIs there any place where Shulchan Aruch rules with the Rosh against the Rif and Rambam?Are there practices where Sepharadim do not hold by Shulchan Aruch?5th part of the shulchan aruch

                                fallocate: fallocate failed: Text file busy in Ubuntu 17.04? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)defragmenting and increasing performance of old lubuntu system with swap partitionIssue with increasing the root partition from the swapthis /usr/bin/dpkg returned error || ubuntu-16.04, 64bitDefault 17.04 swap file locationHow to Resize Ubuntu 17.04 Zesty Swap file size?Ubuntu freezes from online formsMy Laptop is not starting after upgrade ubuntu 16.04 (Kernel 4.8.0-38 to 04.10.0-36)hcp: ERROR: FALLOCATE FAILED!Not sure my swap is being usedWine 3.0 asking for more virtual free swap