SED Command – How to Remove Single Quotes from All Directory and File Names

sed

I ran a sed command recently and I mistyped the command (yes it happens).

So now i have directory and file names that look like 'Call of Duty'. How can I recursively go back and rename all files and directories to remove the '?

this is the command i ran find . -type f -name "*.css" -exec sed -i'' -e 's|http://cdn|//cdn|g' {} +

Best Answer

Are you sure that that is actually the filename? On recent Linux distributions ls displays filenames with spaces in quotes by default. Try ls -N to be sure.

From the man page:

       -N, --literal
              print entry names without quoting