Remove special characters in a text file

if you want to remove special character in the file you just need all symbol in the brackets

code:


$ cat filename
hello@#
world!
$ sed 's/[!@#\$%^&*]//g' filename

output:

hello world

Post a Comment

If you have any doubts, Please let me know
Thanks!

Previous Post Next Post