Score:2

Saving to a different folder in ZIP

bj flag
zip compress.zip /from/this/path/settings.json

I have the command above, but would like to store in /path/settings.json instead of /from/this/path/settings.json in the zip file.

How do I go about it?

sudodus avatar
jp flag
1. Is it enough with a method that works for a single file or do you need a method, that works for a whole directory tree with several directories and subdirectories with files? 2. Would it be OK to use a method with some other tool(s), for example `gzip` (and `tar` if a whole directory tree)?
bilogic avatar
bj flag
actually i found a "workaround", change working directory to `/from/this` and zip from there. But to answer your qn: 1. I would say multiple files, because I'm after the folders, although there is only 1 file now. 2. preferably not, I mean, I just want it to be an easy to read 1 liner.
sudodus avatar
jp flag
Your workaround is good :-) It is possible to use a oneliner (or corresponding alias) also with `tar` (and let it use compression with `gzip`: `tar -cvzf ball.tar.gz directory-tree` or `xz`: `tar -cvJf ball.tar.xz directory-tree`)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.