file displays the file type. To get the mimetype, use the -i option.
$ file Unix.txt
wc tells you the number of lines, words and characters in a file.
$ wc hello.txt
cksum gives you the CRC checksum of some files.
Checksums can be used to protect against accidental modifications to files: if the checksum has not changed, then the file is probably undamaged. The default CRC checksum is not cryptographic.
Cryptographic checksums are those checksums which protect against both accidental modifications and malicious modifications. Use these to verify that there is no trojan inserted into your file. The "md5" algorithm is beginning to show weaknesses against attacks, so "sha1" is preferred.
$ cksum /etc/passwd
$ cksum -a sha1 /etc/passwd
$ cksum -s 'Guide to UNIX'
Have a Unix Problem
Return to : - Unix System Administration Hints and Tips
(c) www.gotothings.com All material on this site is Copyright.