1UNSQUASHFS(1)                    User Commands                   UNSQUASHFS(1)
2
3
4

NAME

6       unsquashfs - tool to uncompress, extract and list squashfs filesystems
7

SYNOPSIS

9       unsquashfs [OPTIONS] FILESYSTEM [files to extract or exclude (with -ex‐
10       cludes) or cat (with -cat )]
11

DESCRIPTION

13       Squashfs is a highly compressed read-only  filesystem  for  Linux.   It
14       uses  either  gzip/xz/lzo/lz4/zstd  compression to compress both files,
15       inodes and directories.  Inodes in the system are very  small  and  all
16       blocks  are  packed to minimise data overhead. Block sizes greater than
17       4K are supported up to a maximum of 1Mbytes (default block size 128K).
18
19       Squashfs is intended for general read-only filesystem use, for archival
20       use  (i.e.  in  cases  where  a  .tar.gz file may be used), and in con‐
21       strained block device/memory systems (e.g. embedded systems) where  low
22       overhead is needed.
23

OPTIONS

25       -v, -version
26              print version, licence and copyright information.
27
28       -cat   cat the files on the command line to stdout.
29
30       -d PATHNAME, -dest PATHNAME
31              extract to PATHNAME, default "squashfs-root".
32
33       -max LEVELS, -max-depth LEVELS
34              descend  at  most LEVELS of directories when extracting or list‐
35              ing.
36
37       -excludes
38              treat files on command line as exclude files.
39
40       -ex, -exclude-list
41              list of files to be excluded, terminated with ; e.g. file1 file2
42              ;.
43
44       -follow, -follow-symlinks
45              follow  symlinks  in  extract  files, and add all files/symlinks
46              needed to resolve extract file. Implies -no-wildcards.
47
48       -missing, -missing-symlinks
49              Unsquashfs will abort if any symlink can't be resolved in  -fol‐
50              low-symlinks.
51
52       -q, -quiet
53              no verbose output.
54
55       -n, -no-progress
56              don't display the progress bar.
57
58       -no, -no-xattrs
59              don't extract xattrs in file system.
60
61       -x, -xattrs
62              extract xattrs in file system (default).
63
64       -u, -user-xattrs
65              only extract user xattrs in file system. Enables extracting xat‐
66              trs.
67
68       -p NUMBER, -processors NUMBER
69              use NUMBER processors.  By default will use the number  of  pro‐
70              cessors available.
71
72       -i, -info
73              print files as they are extracted.
74
75       -li, -linfo
76              print  files as they are extracted with file attributes (like ls
77              -l output).
78
79       -l, -ls
80              list filesystem, but don't extract files.
81
82       -ll, -lls
83              list filesystem with file attributes (like ls  -l  output),  but
84              don't extract files.
85
86       -lln, -llnumeric
87              same as -lls but with numeric uids and gids.
88
89       -lc    list  filesystem  concisely, displaying only files and empty di‐
90              rectories.  Don't extract files.
91
92       -llc   list filesystem concisely with file attributes, displaying  only
93              files and empty directories. Don't extract files.
94
95       -o BYTES, -offset BYTES
96              skip  BYTES at start of FILESYSTEM.  Optionally a suffix of K, M
97              or G can be given to specify Kbytes, Mbytes  or  Gbytes  respec‐
98              tively (default 0 bytes).
99
100       -f, -force
101              if file already exists then overwrite.
102
103       -ig, -ignore-errors
104              treat errors writing files to output as non-fatal.
105
106       -st, -strict-errors
107              treat all errors as fatal.
108
109       -no-exit, -no-exit-code
110              don't set exit code (to nonzero) on non-fatal errors.
111
112       -s, -stat
113              display filesystem superblock information.
114
115       -UTC   use UTC rather than local time zone when displaying time.
116
117       -mkfs-time
118              display  filesystem superblock time, which is an unsigned 32-bit
119              int  representing  the  time  in   seconds   since   the   epoch
120              (1970-01-01).
121
122       -fstime
123              synonym for -mkfs-time.
124
125       -extract-file FILE
126              list of directories or files to extract. One per line.
127
128       -exclude-file FILE
129              list of directories or files to exclude. One per line.
130
131       -pf FILE
132              output  a  pseudo file equivalent of the input Squashfs filesys‐
133              tem.
134
135       -pseudo-file FILE
136              alternative name for -pf.
137
138       -e, -ef EXTRACT FILE
139              synonym for -extract-file.
140
141       -exc, -excf EXCLUDE FILE
142              synonym for -exclude-file.
143
144       -da SIZE, -data-queue SIZE
145              set data queue to SIZE Mbytes.  Default 256 Mbytes.
146
147       -fr SIZE, -frag-queue SIZE
148              set fragment queue to SIZE Mbytes.  Default 256 Mbytes.
149
150       -no-wild, -no-wildcards
151              do not use wildcard matching in extract names.
152
153       -r, -regex
154              treat extract names as POSIX regular expressions rather than use
155              the default shell wildcard expansion (globbing).
156
157       -L     synonym for -follow-symlinks.
158
159       -h, -help
160              output this options text to stdout.
161

DECOMPRESSORS AVAILABLE

163       gzip, lzo, lz4, xz, zstd, lzma
164

EXIT STATUS

166       0      The filesystem listed or extracted OK.
167
168       1      FATAL  errors  occurred, e.g. filesystem corruption, I/O errors.
169              Unsquashfs did not continue and aborted.
170
171       2      Non-fatal errors occurred, e.g. no support for XATTRs,  Symbolic
172              links in output filesystem or couldn't write permissions to out‐
173              put filesystem. Unsquashfs continued and did not abort.
174
175       See -ignore-errors, -strict-errors and -no-exit-code  options  for  how
176       they affect the exit status.
177

EXAMPLES

179       unsquashfs IMAGE.SQFS
180              Extract IMAGE.SQFS to "squashfs-root" in the current working di‐
181              rectory.
182
183       unsquashfs -d output IMAGE.SQFS
184              Extract IMAGE.SQFS to "output" in the current working directory.
185
186       unsquashfs -d . IMAGE.SQFS
187              Extract IMAGE.SQFS to current working directory.
188
189       unsquashfs -linfo IMAGE.SQFS
190              Output a listing of IMAGE.SQFS with file attributes  to  stdout,
191              while extracting the filesystem to "squashfs-root".
192
193       unsquashfs -lls IMAGE.SQFS
194              Output  a  listing of IMAGE.SQFS with file attributes to stdout,
195              but do not extract the filesystem.
196
197       unsquashfs IMAGE.SQFS fs/squashfs
198              Extract only the "fs/squashfs" directory.
199
200       unsquashfs IMAGE.SQFS "[Tt]est/example*"
201              Extract all files beginning with "example" inside top level  di‐
202              rectories called "Test" or "test".
203
204       unsquashfs -excludes IMAGE.SQFS "test/*data*.gz"
205              This  will  extract  everything  except  for  files  that  match
206              *data*.gz in the test directory.  The -excludes option tells Un‐
207              squashfs  to  exclude  the files on the command line rather than
208              extract them.
209
210       unsquashfs -ex "test/*data*.gz" ; IMAGE.SQFS test
211              This uses both extract and exclude options, to  tell  Unsquashfs
212              to  only  extract the "test" directory, and to exclude any files
213              within it that match *data*.gz.
214
215       unsquashfs -dest output -max-depth 2 IMAGE.SQFS
216              Extract only the top two levels of IMAGE.SQFS to "output" direc‐
217              tory.
218
219       unsquashfs -max-depth 2 IMAGE.SQFS "test/*.gz"
220              Only extract the gzipped files in the test directory.
221
222       unsquashfs -llc -max-depth 2 IMAGE.SQFS "test/*.gz"
223              Output  a  listing of the gzipped files in the test directory to
224              stdout, but do not extract them.
225
226       Note: when passing wildcarded  names  to  Unsquashfs,  they  should  be
227       quoted  (as  in  the  above examples), to ensure that they are not pro‐
228       cessed by the shell.
229

AUTHOR

231       Written by Phillip Lougher <phillip@squashfs.org.uk>
232
234       Copyright © 2022 Phillip Lougher <phillip@squashfs.org.uk>
235
236       This program is free software; you can redistribute it and/or modify it
237       under  the  terms of the GNU General Public License as published by the
238       Free Software Foundation; either version 2, or  (at  your  option)  any
239       later version.
240
241       This  program  is  distributed  in the hope that it will be useful, but
242       WITHOUT ANY  WARRANTY;  without  even  the  implied  warranty  of  MER‐
243       CHANTABILITY  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
244       Public License for more details.
245

SEE ALSO

247       mksquashfs(1), sqfstar(1), sqfscat(1)
248
249       The README for the Squash-tools 4.5.1 release, describing the new  fea‐
250       tures              can             be             read             here
251       https://github.com/plougher/squashfs-tools/blob/master/README-4.5.1
252
253       The    Squashfs-tools    USAGE    guide    can     be     read     here
254       https://github.com/plougher/squashfs-tools/blob/master/USAGE
255
256
257
258unsquashfs version 4.5.1         January 2023                    UNSQUASHFS(1)
Impressum