Forrest logo
back to the rhash tool

rhash:tldr:354ce

rhash: Use custom output template.
$ rhash --printf '${%p\t%s\t%{mtime}\t%m\n}' ${filename}
try on your machine

The command you provided is using the rhash utility and the --printf option to format and display information about a file (${filename}) according to the given template ${%p\t%s\t%{mtime}\t%m\n}.

Here's an explanation of the template variables used in the --printf option:

  • ${%p}: Represents the full path of the file.
  • \t: Represents a tab character used for separating fields.
  • ${%s}: Represents the size of the file in bytes.
  • ${%{mtime}}: Represents the modification timestamp of the file.
  • ${%m}: Represents the human-readable modification timestamp of the file.

So, when the command is executed, rhash will substitute these variables with the respective values for the ${filename} provided. The information printed will be in the following format:

<full file path>\t<size in bytes>\t<modification timestamp>\t<human-readable modification timestamp>

For example, if you run the command with filename as "example.txt" and the file is located at "/path/to/example.txt", the output could be something like:

/path/to/example.txt\t1024\t1609458000\tTue Jan 1 00:00:00 2021\n

This format allows you to display specific details about a file using rhash and manipulate the output as needed.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the rhash tool