How to remove end of file names?Delete first part of file namesHow can I batch convert folder names from one date format to anotherHow to remove a number from file names?Recursive rename to remove the end of multiple filenames in a folderRenaming multiple files with complex numbered nameschange many file names to hash (sha256)?zero padding of file names

Is the net charge on a capacitor zero? If yes, then why?

What's the greatest number of hands I can have to annoy my mother-in-law with?

Number of Matrices having determinant 1

Is it possible to kill parasitic worms by intoxicating oneself?

I am ask to complete my withdrawal transaction with COT fee of 1200 dollars

What is a word for "atom or molecule"?

Can the President be impeached twice?

How to optimise the use of 10 nuclear fuel pellets in medieval period?

What is the narrative difference between a Charisma and Wisdom saving throw?

Is it possible for nature to create bubble wrap?

Can someone hack my phone by sending me a file (e.g. PDF) via Whatsapp?

Is Kirk’s comment about “LDS” intended to be a religious joke?

How to prevent discontent among the players when one player murders the others' characters?

Sudden cheap travel?

Why is there a preference to use the cumulative distribution function to characterise a random variable instead of the probability density function?

How to correctly export env variables containing spaces in ZSH

Predicting y from log y as the dependent variable

How can I know if two distributions have the same mean and standard deviation?

What does "x employee is no longer employed by XYZ company" mean?

I've never seen this before. Is this primarily a "rote computational trick" for multiplication by 9 ...?

Why are bicycle tires incapable of maintaining pressure over time, while car tyres seem to have less of a problem?

Was a four year-old forced to sleep on the floor of Leeds General Infirmary?

Sorting marbles based on weightings

Will the same JavaScript fetched by HTTP and HTTPS be cached separately by the browser?



How to remove end of file names?


Delete first part of file namesHow can I batch convert folder names from one date format to anotherHow to remove a number from file names?Recursive rename to remove the end of multiple filenames in a folderRenaming multiple files with complex numbered nameschange many file names to hash (sha256)?zero padding of file names






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









0


















I want to rename a lot of files like 1_16_video1.mp4?1578683110081 & 54_127_video7.mp4?168302 to 1_16_video1.mp4 & 54_127_video7.mp4.



How can I rename them?










share|improve this question

























  • rename allows the use of regex, but have you haven't said what part you want to rename, and what to.

    – guiverc
    Oct 1 at 7:58











  • @guiverc I want to remove the numbers after the mp4 suffix. Look at the names precisely.

    – Mohammad Kholghi
    Oct 1 at 8:01

















0


















I want to rename a lot of files like 1_16_video1.mp4?1578683110081 & 54_127_video7.mp4?168302 to 1_16_video1.mp4 & 54_127_video7.mp4.



How can I rename them?










share|improve this question

























  • rename allows the use of regex, but have you haven't said what part you want to rename, and what to.

    – guiverc
    Oct 1 at 7:58











  • @guiverc I want to remove the numbers after the mp4 suffix. Look at the names precisely.

    – Mohammad Kholghi
    Oct 1 at 8:01













0













0









0








I want to rename a lot of files like 1_16_video1.mp4?1578683110081 & 54_127_video7.mp4?168302 to 1_16_video1.mp4 & 54_127_video7.mp4.



How can I rename them?










share|improve this question














I want to rename a lot of files like 1_16_video1.mp4?1578683110081 & 54_127_video7.mp4?168302 to 1_16_video1.mp4 & 54_127_video7.mp4.



How can I rename them?







bash rename mv filename






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Oct 1 at 7:55









Mohammad KholghiMohammad Kholghi

5734 silver badges21 bronze badges




5734 silver badges21 bronze badges















  • rename allows the use of regex, but have you haven't said what part you want to rename, and what to.

    – guiverc
    Oct 1 at 7:58











  • @guiverc I want to remove the numbers after the mp4 suffix. Look at the names precisely.

    – Mohammad Kholghi
    Oct 1 at 8:01

















  • rename allows the use of regex, but have you haven't said what part you want to rename, and what to.

    – guiverc
    Oct 1 at 7:58











  • @guiverc I want to remove the numbers after the mp4 suffix. Look at the names precisely.

    – Mohammad Kholghi
    Oct 1 at 8:01
















rename allows the use of regex, but have you haven't said what part you want to rename, and what to.

– guiverc
Oct 1 at 7:58





rename allows the use of regex, but have you haven't said what part you want to rename, and what to.

– guiverc
Oct 1 at 7:58













@guiverc I want to remove the numbers after the mp4 suffix. Look at the names precisely.

– Mohammad Kholghi
Oct 1 at 8:01





@guiverc I want to remove the numbers after the mp4 suffix. Look at the names precisely.

– Mohammad Kholghi
Oct 1 at 8:01










2 Answers
2






active

oldest

votes


















5



















Using bash for loop and parameter expansion:



for i in *.mp4*; do 
mv "$i" "$i%?*"
done


The parameter expansion is mentioned in the man page as




$parameter%word Remove matching suffix pattern.




It removes everything after the last ? included.






share|improve this answer
































    0



















    sudo apt install krusader
    sudo apt install krename


    start krusader, highlight which files, or 'select all', 'file multirename' , click 'insert part of filename' button, swipe over the part and carefully check if the results are what you want before proceeding.






    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/4.0/"u003ecc by-sa 4.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );














      draft saved

      draft discarded
















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1177838%2fhow-to-remove-end-of-file-names%23new-answer', 'question_page');

      );

      Post as a guest















      Required, but never shown


























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      5



















      Using bash for loop and parameter expansion:



      for i in *.mp4*; do 
      mv "$i" "$i%?*"
      done


      The parameter expansion is mentioned in the man page as




      $parameter%word Remove matching suffix pattern.




      It removes everything after the last ? included.






      share|improve this answer





























        5



















        Using bash for loop and parameter expansion:



        for i in *.mp4*; do 
        mv "$i" "$i%?*"
        done


        The parameter expansion is mentioned in the man page as




        $parameter%word Remove matching suffix pattern.




        It removes everything after the last ? included.






        share|improve this answer



























          5















          5











          5









          Using bash for loop and parameter expansion:



          for i in *.mp4*; do 
          mv "$i" "$i%?*"
          done


          The parameter expansion is mentioned in the man page as




          $parameter%word Remove matching suffix pattern.




          It removes everything after the last ? included.






          share|improve this answer














          Using bash for loop and parameter expansion:



          for i in *.mp4*; do 
          mv "$i" "$i%?*"
          done


          The parameter expansion is mentioned in the man page as




          $parameter%word Remove matching suffix pattern.




          It removes everything after the last ? included.







          share|improve this answer













          share|improve this answer




          share|improve this answer










          answered Oct 1 at 8:10









          olivoliv

          4102 silver badges7 bronze badges




          4102 silver badges7 bronze badges


























              0



















              sudo apt install krusader
              sudo apt install krename


              start krusader, highlight which files, or 'select all', 'file multirename' , click 'insert part of filename' button, swipe over the part and carefully check if the results are what you want before proceeding.






              share|improve this answer





























                0



















                sudo apt install krusader
                sudo apt install krename


                start krusader, highlight which files, or 'select all', 'file multirename' , click 'insert part of filename' button, swipe over the part and carefully check if the results are what you want before proceeding.






                share|improve this answer



























                  0















                  0











                  0









                  sudo apt install krusader
                  sudo apt install krename


                  start krusader, highlight which files, or 'select all', 'file multirename' , click 'insert part of filename' button, swipe over the part and carefully check if the results are what you want before proceeding.






                  share|improve this answer














                  sudo apt install krusader
                  sudo apt install krename


                  start krusader, highlight which files, or 'select all', 'file multirename' , click 'insert part of filename' button, swipe over the part and carefully check if the results are what you want before proceeding.







                  share|improve this answer













                  share|improve this answer




                  share|improve this answer










                  answered Oct 2 at 6:48









                  pierrelypierrely

                  1435 bronze badges




                  1435 bronze badges































                      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%2f1177838%2fhow-to-remove-end-of-file-names%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

                      Tamil (spriik) Luke uk diar | Nawigatjuun

                      Align equal signs while including text over equalitiesAMS align: left aligned text/math plus multicolumn alignmentMultiple alignmentsAligning equations in multiple placesNumbering and aligning an equation with multiple columnsHow to align one equation with another multline equationUsing \ in environments inside the begintabularxNumber equations and preserving alignment of equal signsHow can I align equations to the left and to the right?Double equation alignment problem within align enviromentAligned within align: Why are they right-aligned?

                      Where does the image of a data connector as a sharp metal spike originate from?Where does the concept of infected people turning into zombies only after death originate from?Where does the motif of a reanimated human head originate?Where did the notion that Dragons could speak originate?Where does the archetypal image of the 'Grey' alien come from?Where did the suffix '-Man' originate?Where does the notion of being injured or killed by an illusion originate?Where did the term “sophont” originate?Where does the trope of magic spells being driven by advanced technology originate from?Where did the term “the living impaired” originate?