How to remove special characters from files in Linux

Eliminate special characters like blank spaces, ^M, ^@, etc.

sed 's[^A-Za-z0-9_.;]//g' file_name.txt>file_name.txt

Comments