What does charcter ^ G mean in vim?
I open an XML file in Vim and found that there are a lot of symbols ^M
and ^G
. So I'm trying to use dos2unix
to strip characters ^M
, but he told me that the file is a binary file, which makes it skip the file. After that, in manunally, the ^G
symbol dos2unix
successfully processes that file. My question is: what does it mean ^G
here? ^G
Does this in the file make it a binary file?
source to share
^G
- bell symbol. When the file is displayed on a traditional terminal, you will hear a beep when you reach that character. There is really no difference between "binary" and "text" files, so itβs dos2unix
just guessing, in which case itβs wrong. You can use the option -f
to force it to convert files it thinks are binary.
source to share
To add to the above answer, Ctrl-M is also usually the end-of-line / line character corresponding to the "\ r \ n" carriage return used by Windows.
You can read more in the answers to this question, including some ways to convert them to unix-style line endings (if you need to): What does the ^ M character mean in Vim?
source to share