Use `find` to locate files like this way: find . -name "* 2" -exec rm -r "{}" \; This command will search for files and folders from where your are `.` with name `"* 2"` and delete every result `-exec rm {}`. If you want to rename directories: find . -name "* 2" -type d -exec rename 's/ 2/-copy/g' {} \; As other command, locate only folders with name `"*.2"` and rename it replacing ` 2` with `-copy`.