4

The output contains one line per file of the form "{hash} SPACE ASTERISK [{directory} SLASH] {filename}".

So what does * mean?

Smit Johnth
  • 611
  • 8
  • 16

1 Answers1

6

From the sha1sum(1) man page:

The default mode is to print a line with checksum, a space, a character indicating input mode ('*' for binary, ' ' for text or where binary is insignificant), and name for each FILE.

Therefore, it means that the file is binary when knowing that is significant.

  • So there is either * or (2 spaces) between hash and filename? Is it the same for md5sum and other checksums? – Smit Johnth Nov 24 '17 at 00:04
  • What do their man pages say? – Ignacio Vazquez-Abrams Nov 24 '17 at 00:08
  • 2
    Why can it be important to know if it's binary or text file? – Smit Johnth Nov 24 '17 at 00:27
  • Not really sure, it's all the same here. – Ignacio Vazquez-Abrams Nov 24 '17 at 00:30
  • 3
    The significance is that Windows uses CR/LF as a new-line sequence, while Linux and OSX use LF. A text file would show different binary check-sums if transferred between Windows and Linux/OSX in Ascii mode, but identifying the file type as text makes sure that the check-sums are the same on each OS by taking account of the local new-line sequence. – AFH Nov 24 '17 at 00:48
  • @AFH does sha1sum & co calculate checksums differently in text/binary mode? – Smit Johnth Nov 24 '17 at 00:53
  • @SmitJohnth - I don't know specifically about sha1sum, but other software reads a CR/LF sequence on Windows as if it were a single LF, and I guess sha1sum does this for check-sum compatibility with non-Windows systems. – AFH Nov 24 '17 at 11:12