0

I want to rename all wordpress admin index files into index_disabled in the folder

/var/www/

I need a script like

find /var/www/ -path '*wp-admin/index.php' -exec mv {} $(dirname {})/index_disabled

but this doesen't work like this

the problem is this: How do i use the {} operator in find execution inside exec

my bash skills are not good enough to complete this ;)

rubo77
  • 2,537

1 Answers1

1

You can use the find command for this:

find /var/www/ -path '*wp-admin/index.php' -exec mv -v {} {}_disabled \;

This will rename all files to {old_name}_disabled.

rubo77
  • 2,537