Jump to content

well that was a shock


crp

Recommended Posts

I've been using linux for about 25 years. seriously, i purchased RH2 on cd's. never as my main system but either as a plaything, a workstation when a gui wasn't needed or (mostly) as a server. Today i found out something which if i did know before i totally forgot.

 

Have a directory with multiple csv files, all starting with "sesamm" and followed by between 3-5 characters. I needed to rename them to "waesle"-whatever.

no problem , i figured. in DOS i would do ren sesamm*.csv waesle*.csv so i'll just do  mv sesamm*.csv waesle*.csv  

Nope! 

That does not work. One gets an error message about a directory waesle123.csv not existing.  Linux does not have a built in command to rename multiple files with one shot. In the end i did them one-by-one. (doing it with for was way too complicated for me to try without testing and debugging.)

 

 

 

Link to comment
Share on other sites

securitybreach

Using find or mv may be easier for you. The second links gives multiple ways of renaming multiple files on linux.

Link to comment
Share on other sites

like i posted , Linux does not have a built in command to rename multiple files at the same time. one needs to install a separate utility or use scripting.

 

Link to comment
Share on other sites

securitybreach

mv is a built in unix command and find is preinstalled (via findutils) on most all distros. Technically Linux is just the kernel, the the rest are apps.

Link to comment
Share on other sites

for loops are awesome. I've worked out a couple ( sometimes with help) that save me heaps of time for actions I do often. And usually quite easy to understand and test.

That said, I usually use the Multi Rename Tool utility in Double Commander for multiple file renaming. 😁

 

 

  • Agree 1
Link to comment
Share on other sites

Quote

Thunar includes a bulk renamer which can be run separately using the command Thunar -B or from within Thunar by selecting two or more files in the main area and pressing F2 or choosing

 

😃

  • Agree 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...