Changing first letter of a filename to uppercase

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











up vote
7
down vote

favorite
1












how can one change first letter of a filename to uppercase using a command line.
IS there any command line to do so?







share|improve this question


























    up vote
    7
    down vote

    favorite
    1












    how can one change first letter of a filename to uppercase using a command line.
    IS there any command line to do so?







    share|improve this question
























      up vote
      7
      down vote

      favorite
      1









      up vote
      7
      down vote

      favorite
      1






      1





      how can one change first letter of a filename to uppercase using a command line.
      IS there any command line to do so?







      share|improve this question














      how can one change first letter of a filename to uppercase using a command line.
      IS there any command line to do so?









      share|improve this question













      share|improve this question




      share|improve this question








      edited Aug 27 at 3:51









      thomasrutter

      25.3k46086




      25.3k46086










      asked Aug 27 at 3:21









      harsh vardhan

      361




      361




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          13
          down vote













          Using the rename command:



          rename -n 's/./U$&/' *



          • -n only shows what changes will be made. After you verify the changes, run without -n to actually rename the files.


          • s/./U$&/: substitutes the first character (.) with the uppercase (U) of whatever was matched ($&).

          Example:



          $ ls
          bar foo
          $ rename -n 's/./U$&/' *
          rename(bar, Bar)
          rename(foo, Foo)





          share|improve this answer




















            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',
            convertImagesToLinks: true,
            noModals: false,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













             

            draft saved


            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1069263%2fchanging-first-letter-of-a-filename-to-uppercase%23new-answer', 'question_page');

            );

            Post as a guest






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            13
            down vote













            Using the rename command:



            rename -n 's/./U$&/' *



            • -n only shows what changes will be made. After you verify the changes, run without -n to actually rename the files.


            • s/./U$&/: substitutes the first character (.) with the uppercase (U) of whatever was matched ($&).

            Example:



            $ ls
            bar foo
            $ rename -n 's/./U$&/' *
            rename(bar, Bar)
            rename(foo, Foo)





            share|improve this answer
























              up vote
              13
              down vote













              Using the rename command:



              rename -n 's/./U$&/' *



              • -n only shows what changes will be made. After you verify the changes, run without -n to actually rename the files.


              • s/./U$&/: substitutes the first character (.) with the uppercase (U) of whatever was matched ($&).

              Example:



              $ ls
              bar foo
              $ rename -n 's/./U$&/' *
              rename(bar, Bar)
              rename(foo, Foo)





              share|improve this answer






















                up vote
                13
                down vote










                up vote
                13
                down vote









                Using the rename command:



                rename -n 's/./U$&/' *



                • -n only shows what changes will be made. After you verify the changes, run without -n to actually rename the files.


                • s/./U$&/: substitutes the first character (.) with the uppercase (U) of whatever was matched ($&).

                Example:



                $ ls
                bar foo
                $ rename -n 's/./U$&/' *
                rename(bar, Bar)
                rename(foo, Foo)





                share|improve this answer












                Using the rename command:



                rename -n 's/./U$&/' *



                • -n only shows what changes will be made. After you verify the changes, run without -n to actually rename the files.


                • s/./U$&/: substitutes the first character (.) with the uppercase (U) of whatever was matched ($&).

                Example:



                $ ls
                bar foo
                $ rename -n 's/./U$&/' *
                rename(bar, Bar)
                rename(foo, Foo)






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Aug 27 at 3:48









                Olorin

                1,648619




                1,648619



























                     

                    draft saved


                    draft discarded















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1069263%2fchanging-first-letter-of-a-filename-to-uppercase%23new-answer', 'question_page');

                    );

                    Post as a guest













































































                    Comments

                    Popular posts from this blog

                    What does second last employer means? [closed]

                    List of Gilmore Girls characters

                    Confectionery