How to replace %002E
with a dot(.
) from all the directories and sub-directories name.
I tried the below command but it's not working
find . | rename -v "s/%002E/./g"
getting this error when I ran on a single file
Can't rename ./doc%002Ejson ./doc.json: Invalid cross-device link
Can't rename ./doc%002Ejson/fileData ./doc.json/fileData: No such file or directory
Can't rename ./doc%002Ejson/metadata ./doc.json/metadata: No such file or directory
Can't rename ./fontDef%002Ejson ./fontDef.json: Invalid cross-device link
Can't rename ./fontDef%002Ejson/fileData ./fontDef.json/fileData: No such file or directory
Can't rename ./fontDef%002Ejson/metadata ./fontDef.json/metadata: No such file or directory
edit:
tired find -depth -type d | rename -n "s/%002E/./g"
as well
I only see
rename(./doc%002Ejson, ./doc.json)
rename(./fontDef%002Ejson, ./fontDef.json)
rename(./listDef%002Ejson, ./listDef.json)
rename(./styleDef%002Ejson, ./styleDef.json)
but when I do ls I still see
doc%002Ejson
instead of doc.json
-type d
instead of-type f
to only look for directories). – AdminBee Sep 24 '20 at 13:03find -depth -type d | rename -n "s/%002E/./g"
– Chris Davies Sep 24 '20 at 13:45find . | rename -v "s/%002E/./g"
returns:rename: not enough arguments
. The commandfind . | xargs -l rename -v "%002E" "."
seems to give me the results you are expecting. – spuck Sep 24 '20 at 14:58