The fclones is a command line tool designed for identifying and managing duplicate files on a file system. It is written in Rust programming language and focuses on high performance and efficiency. This tutorial explains how to install fclones on Ubuntu 24.04.
Install fclones
Check the newest fclones version available on its GitHub repository and assign it to a variable:
FCLONES_VERSION=$(curl -s "https://api.github.com/repos/pkolaczk/fclones/releases/latest" | grep -Po '"tag_name": "v\K[0-9.]+')
Use the earlier identified version to download the fclones archive:
wget -qO fclones.tar.gz https://github.com/pkolaczk/fclones/releases/latest/download/fclones-$FCLONES_VERSION-linux-glibc-x86_64.tar.gz
Extract executable to /usr/local/bin
directory:
sudo tar xf fclones.tar.gz --strip-components=3 -C /usr/local/bin ./usr/bin/fclones
We can check fclones version as follows:
fclones --version
Remove the redundant archive file:
rm -rf fclones.tar.gz
Testing fclones
For testing, create a text file and make a copy of it:
echo "Hello" > test.txt
cp test.txt test2.txt
cp test.txt test3.txt
To search for duplicate files in the current working directory, execute this command:
fclones group .
After the search is complete, the command lists the duplicate files:
[2024-08-05 07:48:11.462] fclones: info: Started grouping
[2024-08-05 07:48:11.464] fclones: info: Scanned 6 file entries
[2024-08-05 07:48:11.464] fclones: info: Found 5 (1.1 KB) files matching selection criteria
[2024-08-05 07:48:11.464] fclones: info: Found 2 (12 B) candidates after grouping by size
[2024-08-05 07:48:11.464] fclones: info: Found 2 (12 B) candidates after grouping by paths
[2024-08-05 07:48:11.467] fclones: info: Found 2 (12 B) candidates after grouping by prefix
[2024-08-05 07:48:11.467] fclones: info: Found 2 (12 B) candidates after grouping by suffix
[2024-08-05 07:48:11.467] fclones: info: Found 2 (12 B) redundant files
# Report by fclones 0.34.0
# Timestamp: 2024-08-05 07:48:11.467 +0300
# Command: fclones group .
# Base dir: /home/adminer
# Total: 18 B (18 B) in 3 files in 1 groups
# Redundant: 12 B (12 B) in 2 files
# Missing: 0 B (0 B) in 0 files
ebd06303ef7ae006626acdd9ca151620, 6 B (6 B) * 3:
/home/adminer/test.txt
/home/adminer/test2.txt
/home/adminer/test3.txt
Uninstall fclones
To fully uninstall fclones, delete the executable file:
sudo rm -rf /usr/local/bin/fclones
Leave a Comment
Cancel reply