I'm trying to compress a directory at
/home/cyrus/sql
And I wanted to change the working directory when zipping the folder:
/ $ zip -b /home/cyrus sql.zip /home/cyrus/sql
But when I check the zip file:
/ $ unzip -l sql.zip
Archive: sql.zip
Length Date Time Name
--------- ---------- ----- ----
0 2013-05-30 10:59 home/cyrus/sql/
1776642 2013-05-23 10:22 home/cyrus/sql/wordpress.sql
--------- -------
1776642 2 files
The root folder should have been sql
. What have I done wrong?
zip
is strange to store full path in archive. – DawnSong May 18 '22 at 00:54