[xubuntu-users] Terminal: Batch Unzip All *.7z Files In Folder While Deleting Each 7z File?

Peter Flynn peter at silmaril.ie
Tue Jun 20 23:31:12 UTC 2017


On 06/20/2017 06:19 PM, Jesse Palser wrote:
> Hi,
> 
> I need to batch(from terminal) decompress all *.7z files in a folder
> while deleting each 7z file.
> How can I do the above in Xubuntu 16.04?

First, install 7z

$ sudo apt-get install p7zip-full

Then in the directory where the .7z files are:

$ for f in *.7z; do 7z e $f; /bin/rm -f $f; done

///Peter




More information about the xubuntu-users mailing list