A squashfs archive differs from most other kinds in that it is a filesystemfile-system. If you've ever booted a linux live disc then you've very likely already seen how this worksin action - very nearly all of these work by mounting a squashfs archive as their root filesystemfile-system. squashfs is supported in vanilla linux kernels since version 2.6.34. And so it is fairly universal to any modern linux system.
...to get at it. The contents of the archive will then be provided you by the kernel's native vfs as a read-only mount, and you can read all files within in the same way you would any other kind of file - and without having to decompress the archive (which is handled on the fly into disk-cache on an as-needed basis by the linux kernel itself). In fact, with the latest kernels' lz4 support, you can likely do this at native speed (and perhaps even faster in some cases) as well - though there will be increased cpu-usage for squashed file access.
To create or decompress a squashfs archive you will need the squashfs-tools package installed. It is not generally installed by distributions as default by any distribution of which I am aware, but I'm notneither am I aware of any distribution which does not provide the package via package-manager. Once installed you can create an archive like:
As you can see - it clearly respects file permissions - and even preserves and respects extended filesystem file-system file attributes (xattrs) in most cases. And the compression ratio you see noted there is in addition to my regular file-system's default lzo compression - (my root fs is btrfs and all files are compressed w/ lzo already) - which is not to mention that much of ~/Downloads is occupied by downloaded compressed archives in the first place.
It is immediately usablemountable as a filesystem itself allproper file-system in its own right:
And last, you don't need any elevated privileges to uncompressdecompress a squashfs archive, only the unsquashfs tool (which is also provided in the squashfs-tools package):
Parallel unsquashfs: Using 6 processors
933 inodes (1025 blocks) to write
[=================================================|] 1025/1025 100%
created 927 files
created 132 directories
created 6 symlinks
created 0 devices
created 0 fifos
this is my new file