Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
0
rated 0 times [  0] [ 0]  / answers: 1 / hits: 4747  / 2 Years ago, sun, october 16, 2022, 4:21:25

I like to use bzip to zip up files because it deletes the original and leaves the new file.



How can I use 7zip to zip up a file and delete the original after it is done zipping?


More From » 7zip

 Answers
0

  1. sudo apt-get install p7zip


  2. p7zip <filename> to compress it (it doesnt leave the original file)


  3. p7zip -d <filename>.7z to decompress it




Sample Run:



~/Temp$ ls -ltrh
total 4.0K
-rwxrwxr-x 1 thefourtheye thefourtheye 851 Jun 18 20:22 TestIP.sh

~/Temp$ p7zip TestIP.sh

7-Zip (A) [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=en_IN,Utf16=on,HugeFiles=on,2 CPUs)
Scanning

Creating archive TestIP.sh.7z

Compressing TestIP.sh

Everything is Ok

~/Temp$ ls -ltrh
total 4.0K
-rw-rw-r-- 1 thefourtheye thefourtheye 567 Jun 20 08:53 TestIP.sh.7z

~/Temp$ p7zip -d TestIP.sh.7z

7-Zip (A) [64] 9.20 Copyright (c) 1999-2010 Igor Pavlov 2010-11-18
p7zip Version 9.20 (locale=en_IN,Utf16=on,HugeFiles=on,2 CPUs)

Processing archive: TestIP.sh.7z

Extracting TestIP.sh

Everything is Ok

Size: 851
Compressed: 567

~/Temp$ ls -ltrh
total 4.0K
-rwxrwxr-x 1 thefourtheye thefourtheye 851 Jun 18 20:22 TestIP.sh

[#30661] Monday, October 17, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
nosaurindb

Total Points: 266
Total Questions: 113
Total Answers: 120

Location: Ecuador
Member since Tue, Jul 26, 2022
2 Years ago
;