Remove duplicate images

Neo

I have original image is img.jpg.

How can I remove duplicate images which are img.jpg1, img.jpg2, img.jpg3. I want to keep the image which have .jpg extension.

Thanks

Sergiy Kolodyazhnyy

Combine the find command with -regex and -exec flags. In this particular example, -exec simply takes all the dupe images and moves them to trash bin, so you still can recover any of them if you choose so. You can later use rm command, or clean trash through GUI

testerdir:$ ls
img.jpg  img.jpg1  img.jpg2  img.jpg3

testerdir:$ find  . -regex ".*\.jpg[1-9]+" -print -exec mv -t $HOME/.local/share/Trash/ {} +                                 
./img.jpg1
./img.jpg3
./img.jpg2

testerdir:$ ls $HOME/.local/share/Trash                                                                                   
expunged/  files/  img.jpg1  img.jpg2  img.jpg3  info/

testerdir:$ ls
img.jpg

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Remove duplicate rows in MySQL

分類Dev

Remove duplicate in a string - javascript

分類Dev

XSL to remove duplicate records

分類Dev

How to remove duplicate entries

分類Dev

Find duplicate images in fastest way

分類Dev

Remove duplicate line in a Google Sheet

分類Dev

How to remove duplicate files in linux

分類Dev

Oracle Remove Duplicate Combination of Three

分類Dev

Oracle Remove Duplicate Combination of Three

分類Dev

remove duplicate a tag in 2 string?

分類Dev

Remove local Docker images on macOS

分類Dev

Remove images from product description

分類Dev

Remove unnessecary Spaces in ListView of Images

分類Dev

golang csv remove duplicate if matching column values

分類Dev

Remove duplicate key and value from json in java

分類Dev

remove consecutive duplicate with a certain values from dataframe

分類Dev

How to remove duplicate values from an array in PHP

分類Dev

How to remove duplicate values from an array in PHP

分類Dev

remove duplicate forward slashes from the URL

分類Dev

Best performance and solution to remove duplicate item in a list

分類Dev

Remove duplicate common output from two list

分類Dev

Remove "Duplicate" from Actions dropdown for Employees

分類Dev

Remove duplicate values from Array of Dictionaries

分類Dev

How to remove duplicate data in JavaScript RowDataPacket Array

分類Dev

Is it possible to remove duplicate sentences / blocks of text in R?

分類Dev

Remove duplicate rows from two different lists?

分類Dev

shell awk script to remove duplicate lines

分類Dev

Angular remove/filter duplicate nationality from array

分類Dev

Remove duplicate value and append the rest of the row value

Related 関連記事

ホットタグ

アーカイブ