Questions tagged [7z]

7z is a compressed archive file format. It's also an application that handles multiple compression formats.

81 questions
89
votes
3 answers

scp and compress at the same time, no intermediate save

What is the canonical way to: scp a file to a remote location compress the file in transit (tar or not, single file or whole folder, 7za or something else even more efficient) do the above without saving intermediate files I am familiar with shell…
Robottinosino
  • 5,271
  • 12
  • 39
  • 51
23
votes
6 answers

How to use 7z to compress via pipe?

I'm using this for creating backups securely (? - is it really secure? with a good password?): # ENCRYPT ORIGDIR="DIRECTORYNAMEHERE"; tar cvf - "${ORIGDIR}/" 2>/dev/null | gzip -9 - 2>/dev/null | openssl aes-256-cbc -salt -out…
gasko peter
  • 5,434
  • 22
  • 83
  • 145
16
votes
6 answers

Find recursively all archive files of diverse archive formats and search them for file name patterns

At best I would like to have a call like this: $searchtool /path/to/search/ -contained-file-name "*vacation*jpg" ... so that this tool does a recursive scan of the given path takes all files with supported archive formats which should at least be…
mdo
  • 271
  • 1
  • 2
  • 6
11
votes
2 answers

Add a file to a different path in a zip file

I have a file that placed in the following directory: folder_A/another_folder_A/file_to_add.xml Now, what I want to do is simply add the file to a folder in an existing zip archive. For example this is my zip…
Daniel-B
  • 111
  • 1
  • 3
11
votes
6 answers

How to specify character encoding for 7z?

Doing 7z x on an archive gives me '20 ª.1 ¯® '$'\302\212''¨à®¢®£à ¤áª ï ã«.rtf' IMG_6527.JPG ''$'\302\212''¨à®¢®£à ¤áª ï, ¨áâ.doc' IMG_6532.JPG ''$'\302\204''®¯ ᮣ« è¥­¨¥(3).doc' IMG_6542.JPG ''$'\302\204\302\212\302\217''.doc'…
pusheax
  • 113
  • 1
  • 1
  • 7
10
votes
3 answers

Extracting a specific file from an archive using 7-Zip

I run Linux Live CD and I need to extract a specific file from a wim-archive that is located on a disk drive. I know a full path to the file in the archive: xubuntu@xubuntu:~$ 7z l winRE.wim | grep -i bootrec.exe 2009-08-28 15:02:29 ....A …
Alexander Pozdneev
  • 881
  • 1
  • 8
  • 20
10
votes
4 answers

How to use 7z to archive all the files and directories (including hidden ones) in a directory?

Because of specifics of my archiving needs I am not comfortable with solid tar.gz archives and use 7z instead. I use the following command to do this: 7z a -t7z -m0=lzma -mx=9 -mfb=64 -md=32m -ms=off ~/my/folder.7z ~/my/folder/* To create an…
Ivan
  • 17,368
  • 35
  • 93
  • 118
8
votes
2 answers

7za - Extract file with password

I have a .7z file which I need to extract the contents of. The problem is, that it's password protected and currently, I have to SSH into the server and enter the password. I would like to this without the need of this. Is this possible? I have…
Phorce
  • 195
  • 1
  • 1
  • 5
7
votes
2 answers

How can I repack zip to 7zip?

How can I safely and quickly repack a zip archive to a 7zip archive? I checked options of 7zip program but I don't see any option to repack. I know I can extract to directory and then pack this directory but is it safe? What if ZIP has paths like…
Tom
  • 227
  • 3
  • 8
7
votes
4 answers

howto inflate AND extract a .tar.bz2 using the 7-zip command line tool

I have a .tar.bz2 file that I want to be decompressed and extracted via the 7-zip commandline tool. So basically I'm looking for the equivalent of tar -xjf foo.tar.bz2 with 7-zip there is only the option "x" for extract, so doing 7z x…
Philipp
  • 71
  • 1
  • 1
  • 2
6
votes
3 answers

How to compress a mysql dump using 7z via a pipe?

I've been attempting to compress my mysqldump output via 7z using the pipe operator (I have seen this question, but its answer uses xz not 7z). This is what I have tried so far: mysqldump -u root -p Linux_Wiki | 7z > backup.sql.7z and: mysqldump…
Josh Pinto
  • 3,483
  • 15
  • 52
  • 87
5
votes
3 answers

Check if file is an archive; if yes, extract

How can I check if a file is an archive and then extract it with 7z? I understand that I could check it by file command but it won't work in scripts because of its output. I can't predict what type of archive it could be. I just want to do something…
Michał
  • 53
  • 1
  • 5
5
votes
1 answer

Encrypt file list when creating 7zip archive on command line

When creating a 7zip archive with file-roller, there is a checkbox labeled "Encrypt the file list too". And it seems to work as you cannot see the file list when opening an archive created with this checkbox ticked until you enter the password…
UTF-8
  • 3,175
  • 5
  • 23
  • 50
5
votes
2 answers

Can I command 7z to skip compression (but not inclusion) of specific files while compressing a directory with its subs?

There is a feature of the WinRAR (for Windows) archiver I love a lot: it can be set up to skip trying to compress particular files (based on their extension (name pattern)) while including them into a compressed archive. When it comes to backing up…
Ivan
  • 17,368
  • 35
  • 93
  • 118
5
votes
2 answers

Get percentage information from 7z command in bash

With archives containing more than 30 files, list of extracted files quickly stops being interesting. I a making a script that extracts a .war archive into a tomcat app folder: When looking in help for 7z command, I noticed this line: -bd:…
Tomáš Zato
  • 1,734
  • 7
  • 24
  • 38
1
2 3 4 5 6