[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.
Post Reply
User avatar
Blaze
DEV Team
DEV Team
Posts: 1432
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus 3.2 Cinnamon x86_64
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 porteus 4.13.3-porteus #1 SMP PREEMPT Sat Sep 23 18:22:13 x86_64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Tobago PRO [Radeon R7 360 / R9 360 OEM] (rev 81) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

User avatar
fanthom
Site Admin
Site Admin
Posts: 4593
Joined: 28 Dec 2010, 02:42
Distribution: Porteus Kiosk
Location: Poland, currently - Cork, IE
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: 1081
Joined: 09 Jan 2011, 18:48
Distribution: Porteus v3.2.5-kde5-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: 888
Joined: 20 Mar 2012, 03:42
Distribution: 3.2.2-64bit xfce/openbox
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 : http://forum.porteus.org/viewtopic.php?f=35&t=44

User avatar
Blaze
DEV Team
DEV Team
Posts: 1432
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus 3.2 Cinnamon x86_64
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 porteus 4.13.3-porteus #1 SMP PREEMPT Sat Sep 23 18:22:13 x86_64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Tobago PRO [Radeon R7 360 / R9 360 OEM] (rev 81) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

User avatar
Ed_P
Contributor
Contributor
Posts: 3216
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit 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: 1081
Joined: 09 Jan 2011, 18:48
Distribution: Porteus v3.2.5-kde5-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: 3216
Joined: 06 Feb 2013, 22:12
Distribution: Cinnamon 3.2.2 64-bit 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: 1432
Joined: 28 Dec 2010, 11:31
Distribution: ⟰ Porteus 3.2 Cinnamon x86_64
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 porteus 4.13.3-porteus #1 SMP PREEMPT Sat Sep 23 18:22:13 x86_64 Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz GenuineIntel GNU/Linux
MS-7A12 » [AMD/ATI] Tobago PRO [Radeon R7 360 / R9 360 OEM] (rev 81) » Vengeance LPX 16GB DDR4 K2 3200MHz C16

Post Reply