How to delete a tracker tag containing special characters
Backslash escapes are supported in the context of the shell's printf
and echo
(with the -e
option) builtins, but to force them to be expanded in a plain string argument you'd need to use ANSI quoting. From man bash
:
Words of the form $'string' are treated specially. The word expands to string, with backslash-escaped characters replaced as specified by the ANSI C standard.
It's a little complicated in your case because there's a single quote (apostrophe) in the tag string, but the following should work:
tracker tag -d $'setup# connections# features# upgrading# troubleshooting# recovery# specifications\r\n#esuprt_desktop#esuprt_alienware_dsk#Alienware Aurora#alienware-aurora#Owner'\''s Manual'
Alternatively, you can compose the CR
character using keyboard sequence Ctrl+V Enter (it will display as ^M
but actually be only a single character). Don't forget to follow it with another Enter for the LF
.