User avatar
Alex_Landherr
Posts: 241
Joined: Mon May 18, 2020 3:14 pm
Location: Sweden
Contact: Twitter

Problem with Zip Command [SOLVED]

Thu Oct 14, 2021 10:11 am

When trying to compress a directory to a zip archive I get this result:

Code: Select all

pi@raspberrypi:/media/pi/RPI4B/Pictures/GOES/GOES_16 $ ls
2021_10_14_09-25-25_UTC  GOES_16_Image_Info.txt
pi@raspberrypi:/media/pi/RPI4B/Pictures/GOES/GOES_16 $ zip -r 2021_10_14_09-25-25_UTC.zip /2021_10_14_09-25-25_UTC
	zip warning: name not matched: /2021_10_14_09-25-25_UTC

zip error: Nothing to do! (try: zip -r 2021_10_14_09-25-25_UTC.zip . -i /2021_10_14_09-25-25_UTC)
pi@raspberrypi:/media/pi/RPI4B/Pictures/GOES/GOES_16 $
I was following this guide:
https://www.circuitbasics.com/working-w ... pberry-pi/

The suggested command only gives me an empty archive file. What should I do?
Last edited by Alex_Landherr on Thu Oct 14, 2021 11:32 am, edited 1 time in total.
Helpful answers are appreciated.
I usually respond to Tweets directed at me.
JWST is the Sagrada Família of spacecrafts.

3D Printer: Original Prusa Mini+

OS:
  • Raspberry Pi OS
  • Windows 10
Programming Languages:
  1. Python
  2. Java

User avatar
kerry_s
Posts: 2348
Joined: Thu Jan 30, 2020 7:14 pm

Re: Problem with Zip Command

Thu Oct 14, 2021 10:21 am

make sure it's installed:

Code: Select all

sudo apt install zip
you know can just use the right click> compress in the file manager

User avatar
rpdom
Posts: 19122
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Problem with Zip Command

Thu Oct 14, 2021 10:31 am

When compressing a directory you either give the full path to the directory starting with a "/", which I guess would be /media/pi/RPI4B/Pictures/GOES/GOES_16/2021_10_14_09-25-25_UTC in your case, or a relative path to the directory either starting without a "/" or starting with "./" which would be either 2021_10_14_09-25-25_UTC or ./2021_10_14_09-25-25_UTC

The relative path without the "/" is usually best.
Unreadable squiggle

User avatar
Alex_Landherr
Posts: 241
Joined: Mon May 18, 2020 3:14 pm
Location: Sweden
Contact: Twitter

Re: Problem with Zip Command

Thu Oct 14, 2021 10:39 am

rpdom wrote:
Thu Oct 14, 2021 10:31 am
When compressing a directory you either give the full path to the directory starting with a "/", which I guess would be /media/pi/RPI4B/Pictures/GOES/GOES_16/2021_10_14_09-25-25_UTC in your case, or a relative path to the directory either starting without a "/" or starting with "./" which would be either 2021_10_14_09-25-25_UTC or ./2021_10_14_09-25-25_UTC

The relative path without the "/" is usually best.
I tried with the "./" and it seems to be working. Is there a way to set the output file name of the archive file (in the zip command that is)?

EDIT: Never mind, I found it.
Helpful answers are appreciated.
I usually respond to Tweets directed at me.
JWST is the Sagrada Família of spacecrafts.

3D Printer: Original Prusa Mini+

OS:
  • Raspberry Pi OS
  • Windows 10
Programming Languages:
  1. Python
  2. Java

Return to “Troubleshooting”