[SOLVED] How to extract all xzm files to one folder only

Post here if you are a new Porteus member and you're looking for some help.
User avatar
Blaze
DEV Team
DEV Team
Posts: 3869
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

[SOLVED] How to extract all xzm files to one folder only

Post#1 by Blaze » 03 Sep 2017, 11:05

Anybody knows how to extract all xzm files to one folder only?

For example, I have 1st.xzm, 2nd.xzm, 3rd.xzm and 1 folder.
I want extract all zxm files to this folder.
xzm2dir *.xzm folder
does not wotk.
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

User avatar
fanthom
Moderator Team
Moderator Team
Posts: 5666
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland
Contact:

How to extract all xzm files to one folder only

Post#2 by fanthom » 03 Sep 2017, 11:20

Hi Blaze,

I'm using this script:

Code: Select all

#!/bin/sh

cd `pwd`
for x in `find -type f | fgrep .xzm | sort`; do unsquashfs -n -f $x >/dev/null; done
It unpacks all modules even if they are placed in subfolders.
Please add [Solved] to your thread title if the solution was found.

User avatar
wread
Module Guard
Module Guard
Posts: 1255
Joined: 09 Jan 2011, 18:48
Distribution: Porteus v5.0-kde-64 bits
Location: Santo Domingo
Contact:

How to extract all xzm files to one folder only

Post#3 by wread » 03 Sep 2017, 13:46

Great!
One can patch 05-devel mit /usr/bin/extractxzms by fanthom!

:D
Porteus is proud of the FASTEST KDE ever made.....(take akonadi, nepomuk and soprano out and you will have a decent OS).
The Porteus Community never sleeps!

User avatar
ncmprhnsbl
DEV Team
DEV Team
Posts: 3924
Joined: 20 Mar 2012, 03:42
Distribution: v5.0-64bit
Location: australia
Contact:

How to extract all xzm files to one folder only

Post#4 by ncmprhnsbl » 03 Sep 2017, 13:49

i've been using (from the folder of xzms):

Code: Select all

for a in *.xzm; do xzm2dir $a /path/to/directory; done
what fanthom has is better tho(for the sub folders bit)
Forum Rules : https://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Blaze
DEV Team
DEV Team
Posts: 3869
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

How to extract all xzm files to one folder only

Post#5 by Blaze » 03 Sep 2017, 15:16

Wow, this is what I need.
It's save me a lot of time.
Thanks.
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

[SOLVED] How to extract all xzm files to one folder only

Post#6 by Ed_P » 03 Sep 2017, 19:31

Excuse my ignorance fanthom but what is the pwd directory?
Ed

User avatar
wread
Module Guard
Module Guard
Posts: 1255
Joined: 09 Jan 2011, 18:48
Distribution: Porteus v5.0-kde-64 bits
Location: Santo Domingo
Contact:

[SOLVED] How to extract all xzm files to one folder only

Post#7 by wread » 03 Sep 2017, 19:55

pwd=print (name of) working directory
Porteus is proud of the FASTEST KDE ever made.....(take akonadi, nepomuk and soprano out and you will have a decent OS).
The Porteus Community never sleeps!

User avatar
Ed_P
Contributor
Contributor
Posts: 8341
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 5.01 ISO
Location: Western NY, USA

[SOLVED] How to extract all xzm files to one folder only

Post#8 by Ed_P » 03 Sep 2017, 22:39

^ Really!! :o

Thank you wread
Ed

User avatar
Blaze
DEV Team
DEV Team
Posts: 3869
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus current ☯ all DEs ☯
Location: ☭ Russian Federation, Lipetsk region, Dankov
Contact:

[SOLVED] How to extract all xzm files to one folder only

Post#9 by Blaze » 09 Sep 2017, 15:31

fanthom wrote:
03 Sep 2017, 11:20

Code: Select all

#!/bin/sh

cd `pwd`
for x in `find -type f | fgrep .xzm | sort`; do unsquashfs -n -f $x >/dev/null; done
The same in current directory

Code: Select all

for x in `find . -type f | fgrep .xzm | sort`; do unsquashfs -n -f $x >/dev/null; done
Linux 6.6.11-porteus #1 SMP PREEMPT_DYNAMIC Sun Jan 14 12:07:37 MSK 2024 x86_64 Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Navi 23 [Radeon RX 6600] [1002:73ff] (rev c7) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

Post Reply