Find Duplicate Files Using the Command Line on a Mac (or Linux)

In this video I use a number of different command line utilities to identify duplicate files.

Print Working Directory
pwd
Find All Files in Current Directory
find ./
Find Only Files (no directories)
find ./ -type f
Find Only Non-empty Files (no directories)
find ./ -type f -not -empty
Find Only Non-empty Files and Exclude Files in Library Directory (no directories)
find ./ -type f -not -empty -not -path './/Library/*'
Get md5sum of Find Results (Mac)
find ./ -type f -not -empty -not -path './/Library/*' -exec md5 -r {} \;
Get md5sum of Find Results (Linux)
find ./ -type f -not -empty -not -path './/Library/*' -exec md5sum {} \;

Note: use “md5 -r” on Mac and “md5sum” on Linux in any future command.

Write md5sums to File
find ./ -type f -not -empty -not -path './/Library/*' -exec md5 -r {} \; > file_list.txt
Count the Number of Lines in file_list.txt
wc -l file_list.txt
Get list of md5sums for Jpeg Files
find ./ -type f -not -empty -not -path './/Library/*' -iname '*.jpg' -exec md5 -r {} \; > file_list.txt
View first 10 Lines of a File
head -n 10 file_list.txt
View first 20 Lines of File
head -n 20 file_list.txt
Sort file_list.txt
sort file_list.txt > file_list_sort.txt
Output file_list_sort.txt to Terminal
cat file_list_sort.txt
Isolate the md5sums
cat file_list_sort.txt | cut -d ' ' -f1
Count Each md5sum
cat file_list_sort.txt | cut -d ' ' -f1 | uniq -c
Remove md5sums of Files that only have 1 Copy
cat file_list_sort.txt | cut -d ' ' -f1 | uniq -c | grep -v '^   1 '
Swap md5sum and Count
cat file_list_sort.txt | cut -d ' ' -f1 | uniq -c | grep -v '^   1 ' | awk '{ t=$1 ; $1=$2; $2=t; print }'
Sort md5sum and Count List by Hash
cat file_list_sort.txt | cut -d ' ' -f1 | uniq -c | grep -v '^   1 ' | awk '{ t=$1 ; $1=$2; $2=t; print }' | sort
Write Results to File
cat file_list_sort.txt | cut -d ' ' -f1 | uniq -c | grep -v '^   1 ' | awk '{ t=$1 ; $1=$2; $2=t; print }' | sort > file_counts.txt
Join File List to md5sum Counts
join -1 1 -2 1 file_counts.txt file_list_sort.txt
Sort Joined Results
join -1 1 -2 1 file_counts.txt file_list_sort.txt |sort -k2,2 -n -k1,1
Save Joined Results to a File
join -1 1 -2 1 file_counts.txt file_list_sort.txt |sort -k2,2 -n -k1,1 > file_dups.txt

Wired Ergonomic Mouse for a Righty or a Lefty

In this video I look at the Anker Right Handed Ergonomic Mouse and it’s long lost cousin the Perixx Left Handed Ergonomic Mouse.

Anker Right Handed Mouse
Wired: https://amzn.to/2WuU5p5 (Amazon Affiliate)
Wireless: https://amzn.to/2UuONIC (Amazon Affiliate)

Perixx Left Handed Mouse
PERIMICE-513L Wired: https://amzn.to/2Tl4QZd (Amazon Affiliate)
PERIMICE-713L Wireless: https://amzn.to/2UrNs51 (Amazon Affiliate)

A Look at the Smallest (Excel) Spreadsheet Formats (and shrinking with advzip)

In this video I look at which format is the smallest for saving Excel spreadsheets.

View Files in xlsx File
zipinfo salesrecords.xlsx
View Files in ods File
zipinfo salesrecords.xlsx
Install advancecomp on Mac (using Macports)
sudo port install advancecomp
Install advancecomp on Ubuntu
sudo port install advancecomp
Optimize xlsx Compression
advzip -z4 salesrecords.xlsx