[Question] Batch-moving archives with a specific type of file in them

SomeGamer

Well-Known Member
OP
Member
Joined
Dec 19, 2014
Messages
6,827
Trophies
1
XP
4,912
Country
Hungary
Basically the title. :P I have a ton of archives (7z, zip and rar) which I want to move to another location if they have a file with a specific name/extension in them. Could find no such program searching online. Thanks in advance!
 

kuwanger

Well-Known Member
Member
Joined
Jul 26, 2006
Messages
1,510
Trophies
0
XP
1,783
Country
United States
Bash script:

for f in *.7z *.rar *.zip; do if [[ "$(7z l "$f" | grep \\.ext$)" != "" ]]; then mv "$f" destination; fi; done
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: @Sonic Angel Knight, Why is it all in lower-case?