[root@localhost cmp]# cat -n a.txt 1 this is line a 2 this is line b 3 helloworld! 4 this is line d [root@localhost cmp]# cat -n b.txt 1 this is line a 2 this is line b 3 this is line c 4 this is line d [root@localhost cmp]# cat -n c.txt 1 this is line a 2 this is line b 3 helloworld! 4 this is line d [root@localhost cmp]#
[root@localhost cmp]# cat -n a.txt 1 this is line a 2 this is line b 3 helloworld! 4 this is line d [root@localhost cmp]# cat -n b.txt 1 this is line a 2 this is line b 3 this is line c 4 this is line d [root@localhost cmp]#
[root@localhost cmp]# vim a.txt [root@localhost cmp]# cat a.txt this is line a this is line b helloworld! this is line d this is some new word [root@localhost cmp]#
[root@localhost cmp]# cat -n a.txt 1 this is line a 2 this is line b 3 helloworld! 4 this is line d [root@localhost cmp]# cat -n b.txt 1 this is line a 2 this is line b 3 this is line c 4 this is line d [root@localhost cmp]# cat -n c.txt 1 this is line a 2 this is line b 3 helloworld! 4 this is line d [root@localhost cmp]#
[root@localhost cmp]# cat -n a.txt 1 this is line a 2 this is line b 3 helloworld! 4 this is line d [root@localhost cmp]# cat -n b.txt 1 this is line a 2 this is line b 3 this is line c 4 this is line d [root@localhost cmp]# sha1sum a.txt b.txt 01c3d325eeca7f806192dddbfa9ce791cb5c6fc7 a.txt 1cb5cee11036b493799b8b1b0d6ea9704e84c282 b.txt [root@localhost cmp]#
[root@localhost cmp]# cat -n a.txt 1 this is line a 2 this is line b 3 helloworld! 4 this is line d 5 this is a new line [root@localhost cmp]# cat -n b.txt 1 this is line a 2 this is line b 3 this is line c 4 this is line d [root@localhost cmp]#
-b, --binary 以二进制模式读取 -c, --check 从文件中读取SHA1 的校验值并予以检查 --tag create a BSD-style checksum -t, --text 以纯文本模式读取(默认) Note: There is no difference between binary and text mode option on GNU system.
The following four options are useful only when verifying checksums: --quiet don't print OK for each successfully verified file --status don't output anything, status code shows success --strict exit non-zero for improperly formatted checksum lines -w, --warn warn about improperly formatted checksum lines
--help 显示此帮助信息并退出 --version 显示版本信息并退出
The sums are computed as described in FIPS-180-1. When checking, the input should be a former output of this program. The default mode is to print a line with checksum, a character indicating input mode ('*' for binary, space for text), and name for each FILE.
NAME sha1sum - compute and check SHA1 message digest
SYNOPSIS sha1sum [OPTION]... [FILE]...
DESCRIPTION Print or check SHA1 (160-bit) checksums. With no FILE, or when FILE is -, read standard input.
-b, --binary read in binary mode
-c, --check read SHA1 sums from the FILEs and check them
--tag create a BSD-style checksum
-t, --text read in text mode (default)
Note: There is no difference between binary and text mode option on GNU system.
The following four options are useful only when verifying checksums: --quiet don't print OK for each successfully verified file
--status don't output anything, status code shows success
--strict exit non-zero for improperly formatted checksum lines
-w, --warn warn about improperly formatted checksum lines
--help display this help and exit
--version output version information and exit
The sums are computed as described in FIPS-180-1. When checking, the input should be a former output of this program. The default mode is to print a line with checksum, a character indicating input mode ('*' for binary, space for text), and name for each FILE.
GNU coreutils online help: <http://www.gnu.org/software/coreutils/> Report sha1sum translation bugs to <http://translationproject.org/team/>
AUTHOR Written by Ulrich Drepper, Scott Miller, and David Madore.
SEE ALSO The full documentation for sha1sum is maintained as a Texinfo manual. If the info and sha1sum programs are properly installed at your site, the command