Skip to main content
formatting
Source Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 263

I have a file structure that I had to recover and it contains :2f in the name

For example directory name anyname:2fmorenameanyname:2fmorename

I want to be able to change :2f:2f to __ in all directories and sub directories.

I thinking something like

find . -name :2f -type d -execdir mv{} _ ;

find . -name *:2f* -type d -execdir mv{} *_* \;

But I can not figure out for sure.

I have a file structure that I had to recover and it contains :2f in the name

For example directory name anyname:2fmorename

I want to be able to change :2f to _ in all directories and sub directories.

I thinking something like

find . -name :2f -type d -execdir mv{} _ ;

But I can not figure out for sure.

I have a file structure that I had to recover and it contains :2f in the name

For example directory name anyname:2fmorename

I want to be able to change :2f to _ in all directories and sub directories.

I thinking something like

find . -name *:2f* -type d -execdir mv{} *_* \;

But I can not figure out for sure.

Source Link
Bill
  • 111
  • 1
  • 4

Find and replace string in directory names

I have a file structure that I had to recover and it contains :2f in the name

For example directory name anyname:2fmorename

I want to be able to change :2f to _ in all directories and sub directories.

I thinking something like

find . -name :2f -type d -execdir mv{} _ ;

But I can not figure out for sure.