How to remove escaped characters in filenames? How to remove escaped characters in filenames? bash bash

How to remove escaped characters in filenames?


If $file is your filename:

my $file = '=Web_Help_Desk_Pro%26Lite.pdf';$file =~ s/%[0-9a-f]{2}//gi;

i.e. replace % followed by two hex characters with the empty string.


To just remove the percent sign and the following two hex digits:

$path =~ s/%[\da-f][\da-f]//gi;


This should work

sed 's/%[[:alnum:]]\{2\}//g' INPUT_FILE