CSHATAG(1)
π CSHATAG(1) β like, the compiled shatag, bestie β¨
okay so this is cshatag(1), from the User Manuals section, and it's genuinely one of my faves π«Ά
β¨ NAME β¨
cshatag β the compiled shatag, periodt π
πΈ SYNOPSIS πΈ
cshatag [OPTIONS] FILE [FILE...]
π¦ DESCRIPTION π¦
cshatag is a minimal and fast re-implementation of shatag ( https://github.com/maugier/shatag , written in Python by Maxime Augier ) but in a compiled language β and the way it leveled up: since v2.0 it's Go, and earlier versions were C π
So what does it even do? cshatag is a tool to detect silent data corruption πβ¨ It writes the mtime and the sha256 checksum of a file into the file's extended attributes. For that to work, the filesystem needs to be mounted with user_xattr enabled β no cap, that's the vibe check it has to pass.
When you run it again, it compares the stored mtime and checksum. If it finds that the mtime is unchanged but the checksum has changed, it warns on stderr π¨. In any case, the status of the file is printed to stdout and the stored checksum is updated. Iconic behaviour, honestly.
The file statuses that show up on stdout are:
<new>β file is missing both attributes<outdated>β bothmtimeand checksum have changed<ok>β both checksum andmtimestayed the same<timechange>β onlymtimehas changed, checksum stayed the same<corrupt>βmtimestayed the same but checksum changed π
cshatag aims to be format-compatible with shatag and uses the same extended attributes (see the COMPATIBILITY section, bestie).
Fun lore drop π cshatag was written in C in 2012 and has been rewritten in Go in 2019.
π OPTIONS π
-dry-runβ don't make any changes π just look, don't touch-recursiveβ recursively process the contents of directories π-removeβ remove cshatag's xattrs from FILE π§Ή-qβ quiet mode β don't report<ok>files π€«-qqβ quiet2 mode β only report<corrupt>files and errors π-fixβ fix the storedsha256on corrupt files π§
π EXAMPLES π
Check all regular files in the file tree below the current working directory:
# cshatag -qq -recursive .
Errors like corrupt files will be printed to stderr. Run it without -qq to see progress output π.
To remove the extended attributes from all files:
# cshatag -recursive -remove .
π RETURN VALUE π
0β Success β¨1β Wrong number of arguments π2β One or more files could not be opened π3β One or more files is not a regular file π4β Extended attributes could not be written to one or more files π«5β At least one file was found to be corrupt π¨6β More than one type of error occurred π₯
π§ COMPATIBILITY π§
cshatag writes the user.shatag.ts field with full integer nanosecond precision, while python uses a double for the whole mtime and loses the last few digits. So yeah β we're out here being precise, they're out here rounding ππ
π AUTHOR π
Jakob Unterwurzacher <jakobunt@gmail.com>
https://github.com/rfjakob/cshatag
β COPYRIGHT β
Copyright 2012 Jakob Unterwurzacher. MIT License.
π SEE ALSO π
shatag(1), sha256sum(1), getfattr(1), setfattr(1)
k that's the whole page, bestie π«Ά this one's a Linux manual page, from MAY 2012, and the source is CSHATAG(1) β go forth and verify your checksums, mwah ππ
π¦ where this page comes from
- nixos 26.05: cshatag 2.2.1
- nixpkgs unstable: cshatag 2.2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms