Changing file extension












0















I have about 1000 images saved in a weird way.



"file_name".jpeg?image=%2Fmars%2Freadonly%2Fthemis%2Fpds%2FODTGEO_v2%2Fbrowse%2Fodtbws2_0050%2Fv545xxbws2%2FV54577010POL.png&rotate=0&format=jpeg


I want to convert all of the files into just .jpeg.



What command do I use?










share|improve this question




















  • 1





    You want to remove the part from ? till the end?

    – George Udosen
    Jan 8 at 17:21











  • yeah exactly just have them all as .jpeg

    – Pruthvi Acharya
    Jan 8 at 17:51
















0















I have about 1000 images saved in a weird way.



"file_name".jpeg?image=%2Fmars%2Freadonly%2Fthemis%2Fpds%2FODTGEO_v2%2Fbrowse%2Fodtbws2_0050%2Fv545xxbws2%2FV54577010POL.png&rotate=0&format=jpeg


I want to convert all of the files into just .jpeg.



What command do I use?










share|improve this question




















  • 1





    You want to remove the part from ? till the end?

    – George Udosen
    Jan 8 at 17:21











  • yeah exactly just have them all as .jpeg

    – Pruthvi Acharya
    Jan 8 at 17:51














0












0








0








I have about 1000 images saved in a weird way.



"file_name".jpeg?image=%2Fmars%2Freadonly%2Fthemis%2Fpds%2FODTGEO_v2%2Fbrowse%2Fodtbws2_0050%2Fv545xxbws2%2FV54577010POL.png&rotate=0&format=jpeg


I want to convert all of the files into just .jpeg.



What command do I use?










share|improve this question
















I have about 1000 images saved in a weird way.



"file_name".jpeg?image=%2Fmars%2Freadonly%2Fthemis%2Fpds%2FODTGEO_v2%2Fbrowse%2Fodtbws2_0050%2Fv545xxbws2%2FV54577010POL.png&rotate=0&format=jpeg


I want to convert all of the files into just .jpeg.



What command do I use?







files file-format






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 8 at 17:26









Kulfy

4,29651442




4,29651442










asked Jan 8 at 17:16









Pruthvi AcharyaPruthvi Acharya

1




1








  • 1





    You want to remove the part from ? till the end?

    – George Udosen
    Jan 8 at 17:21











  • yeah exactly just have them all as .jpeg

    – Pruthvi Acharya
    Jan 8 at 17:51














  • 1





    You want to remove the part from ? till the end?

    – George Udosen
    Jan 8 at 17:21











  • yeah exactly just have them all as .jpeg

    – Pruthvi Acharya
    Jan 8 at 17:51








1




1





You want to remove the part from ? till the end?

– George Udosen
Jan 8 at 17:21





You want to remove the part from ? till the end?

– George Udosen
Jan 8 at 17:21













yeah exactly just have them all as .jpeg

– Pruthvi Acharya
Jan 8 at 17:51





yeah exactly just have them all as .jpeg

– Pruthvi Acharya
Jan 8 at 17:51










1 Answer
1






active

oldest

votes


















0














I don't fully follow your quest but I have this little script that can return the filename without that long part but retains the " quotes and I suspect that some of those files have spaces in their names so they might have to stay.



for i in /path/to/files/*; do mv "$(realpath $i)" "$(realpath "${i%%?*}"); done


Result:



"file_name".jpeg


Note: I couldn't create a sample with that name so I used a varaible in a script.






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',
    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%2f1108062%2fchanging-file-extension%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














    I don't fully follow your quest but I have this little script that can return the filename without that long part but retains the " quotes and I suspect that some of those files have spaces in their names so they might have to stay.



    for i in /path/to/files/*; do mv "$(realpath $i)" "$(realpath "${i%%?*}"); done


    Result:



    "file_name".jpeg


    Note: I couldn't create a sample with that name so I used a varaible in a script.






    share|improve this answer






























      0














      I don't fully follow your quest but I have this little script that can return the filename without that long part but retains the " quotes and I suspect that some of those files have spaces in their names so they might have to stay.



      for i in /path/to/files/*; do mv "$(realpath $i)" "$(realpath "${i%%?*}"); done


      Result:



      "file_name".jpeg


      Note: I couldn't create a sample with that name so I used a varaible in a script.






      share|improve this answer




























        0












        0








        0







        I don't fully follow your quest but I have this little script that can return the filename without that long part but retains the " quotes and I suspect that some of those files have spaces in their names so they might have to stay.



        for i in /path/to/files/*; do mv "$(realpath $i)" "$(realpath "${i%%?*}"); done


        Result:



        "file_name".jpeg


        Note: I couldn't create a sample with that name so I used a varaible in a script.






        share|improve this answer















        I don't fully follow your quest but I have this little script that can return the filename without that long part but retains the " quotes and I suspect that some of those files have spaces in their names so they might have to stay.



        for i in /path/to/files/*; do mv "$(realpath $i)" "$(realpath "${i%%?*}"); done


        Result:



        "file_name".jpeg


        Note: I couldn't create a sample with that name so I used a varaible in a script.







        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 8 at 18:15

























        answered Jan 8 at 17:56









        George UdosenGeorge Udosen

        20.6k94568




        20.6k94568






























            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%2f1108062%2fchanging-file-extension%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

            Human spaceflight

            Can not write log (Is /dev/pts mounted?) - openpty in Ubuntu-on-Windows?

            File:DeusFollowingSea.jpg