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)?
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.
– bilogicJan 23 '23 at 10:03
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)
– sudodusJan 23 '23 at 10:18
gzip
(andtar
if a whole directory tree)?/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. – bilogic Jan 23 '23 at 10:03tar
(and let it use compression withgzip
:tar -cvzf ball.tar.gz directory-tree
orxz
:tar -cvJf ball.tar.xz directory-tree
) – sudodus Jan 23 '23 at 10:18