]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
docs: A note to cat that hexdump should be used for binary data
authorGlenn Washburn <development@efficientek.com>
Wed, 26 Jul 2023 18:50:12 +0000 (13:50 -0500)
committerDaniel Kiper <daniel.kiper@oracle.com>
Mon, 14 Aug 2023 15:55:01 +0000 (17:55 +0200)
The cat command should not be used to print binary data because it can
show bytes not in the binary data and not show bytes that are in the data,
which can lead to confusion. This happens because cat does some processing
of the data stream, namely trying to decode substrings as UTF-8.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Oskari Pirhonen <xxc3ncoredxx@gmail.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
docs/grub.texi

index 3634507acf2989f56c55600c8e5363b5da80d370..b233e28e0c17794ce9287d2241c0fed7b370a70c 100644 (file)
@@ -4507,6 +4507,12 @@ will be displayed as a simple new line.  Otherwise, the carriage return will
 be displayed as a control character (@samp{<d>}) to make it easier to see
 when boot problems are caused by a file formatted using DOS-style line
 endings.
+
+Note: @command{cat} can be used to view the contents of devices using the
+block list syntax (@pxref{Block list syntax}). However, it is not advised
+to view binary data because it will try to decode UTF-8 strings, which can
+lead to some bytes missing or added in the output. Instead, use the
+@command{hexdump} command (@pxref{hexdump}).
 @end deffn