by balls187 · 11y ago · 0 comments
x: extract
v: verbose
z: zip (or unzip) archive
f: file name to follow.
> Do you think you would ever discover that combination on your own from reading the man pages?
Yes. Turns out, I wanted to tar up my nodejs directory, but omit the `node_modules` folder.
> Of course the command line makes many things easier.
Exactly. I'm not a high level computer scientist, but I imagine, being able to easily deal with files and data would help things out quite a bit. So there while it can be painful to learn bash, it's something that pays off heaps in the long run. My opinion.
For example, to create an xz-compressed tar file:
tar cJvf archive.tar.xz some_directory/
Generally, you can omit those when uncompressing, at least with GNU tar.
OpenBSD's tar is less friendly - it doesn't seem to try to autodetect the compression format. Last time I checked, it didn't support xz either. One had to install the package and then do something such as tar cf - directory/ | xz > something.txz
where the - means that the tarball is written to standard output. /dev/stdout would work as well.