cat file.txt | tr -d '[:punct:]' | tr ' ' '\n' | grep c | sort | uniq > output.txt
Thank you so much, you saved me good amount of searching. I finally had to replace the special character to do the task quicker. I tried to escape it with single and double quotes but it didn't work.
What is the special character? $ or something else?
I don't know if 'special character' is the right expression, I just wanted to extract those.