Skip site navigation (1)Skip section navigation (2)

  
 
  

home | help
HASHCP(1)		      HashCp Documentation		       HASHCP(1)

NAME
     HashCp - Hash and copy the contents of a file or stdin.

SYNOPSIS
     hashcp {source|-} target

     Note: Command line arguments are position dependent.

DESCRIPTION
     HashCp is a utility that hashes a file as it is being copied to new name
     and/or location.  The output produced by this utility is roughly equivalent
     to FTimes output produced with the following FieldMask:

	 none+size+md5+sha1

     It is not exactly equivalent to FTimes output because the name field is not
     encoded and it may contain a relative path depending on how the target file
     was specified.

MODES OF OPERATION
     Currently, HashCp only has one mode of operation, which is given in the
     SYNOPSIS.

RETURN VALUES
     Upon successful completion, a value of 0 (XER_OK) is returned.  Otherwise,
     one of the following error codes is returned:

     *	  1 = XER_Usage

     *	  2 = XER_Abort

EXAMPLES
   Example 1. Standard hash and copy operation
     This example demonstrates how to hash a file called 'out' (in the current
     directory) and copy it to '/tmp/out'.

	 hashcp out /tmp/out

   Example 2. Hash and copy with input from echo(1)
     This example demonstrates how to hash stdin and copy it to a file called
     'out.echo'.  The data for stdin will be generated by the echo(1) command.

	 echo "This is a test." | hashcp - out.echo

   Example 3. Hash and copy with input from dd(1)
     This example demonstrates how to hash stdin and copy it to a file called
     'out.zero'.  The data for stdin will be generated by the dd(1) command
     reading from /dev/zero.

	 dd if=/dev/zero bs=32k count=1 | hashcp - out.zero

SEE ALSO
     cp(1), ftimes(1)

AUTHOR
     Klayton Monroe

HISTORY
     This utility was initially written to make the process of copying and vali-
     dating files more efficient.  For example, suppose you need to archive some
     files for long-term storage (e.g., copy them to an external drive).  In
     that case, you may also want to verify the integrity of those files before
     you store the drive away in your evidence locker.	This utility allows you
     to do both.

     This utility first appeared in FTimes 3.9.0.

perl v5.42.3			   2026-08-27			       HASHCP(1)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=hashcp&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>

home | help