Artificial intelligent assistant

using random in tar to decompress files i want to decompress tar to specific folder, using random ( or anything else), because the content of tar is similar In Win/batch random is used: SET /A num=%random% %%100 for /d /r . %%d in (%folder%) do @if exist "%%d" ren "%%d" folder%num% But in Linux/bash (???) This is my case: folder/1.tar 2.tar 3.tar.gz cat *.tar.* *.tgz | tar -C folder/$RANDOM -zxvf - -i example folder/ 1/content of 1.tar 2/content of 2.tar 3/content of 3.tar.gz

This achieves what you're after


for F in *.tar *.tgz; do R=$RANDOM ; mkdir folder/$R ; tar -C folder/$R -zxvf $F -i; done

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 265aa8fff6ae09ed952a6f11207e01e8