[Shell command] Remove double quotes from a string

Created on November 28, 2026

You can remove double quotes from a string by passing " to the -d option of the tr command.

Example

Create a file named sample.txt with the following contents.

"one"
"two"
"three"

Use cat to print the file and pipe its output to tr to remove the double quotes.

cat sample.txt | tr -d '"'

The command produces the following output.

one
two
three
Shell command