-
-
Save techie2000/ea3897757652bf04481cdcfa999283e3 to your computer and use it in GitHub Desktop.
ln -P ../source/*.bar ../destination/ |
Let the system find and hardlink duplicate files
https://www.systutorials.com/docs/linux/man/1-hardlink/
hardlink [-c] [-n] [-v] [-vv] [-h] directory1 [ directory2 ... ]
-c, --content
Compare only the contents of the files being considered for consolidation. Disregards permission, ownership and other differences.-f, --force
Force hardlinking across file systems.-n, --dry-run
Do not perform the consolidation; only print what would be changed.-v, --verbose
Print summary after hardlinking.-vv,
Print every hardlinked file and bytes saved. Also print summary after hardlinking.-x, --exclude regex
Exclude files and directories matching pattern from hardlinking.The optional pattern for excluding files and directories must be a PCRE2 compatible regular expression. Only the basename of the file or directory is checked, not its path. Excluded directories' contents will not be examined.
-h, --help
Display help text and exit.
-V, --version
Display version information and exit.
or
cp -lr <src> <target>