16 ms·
Why not just learn what the flags mean? If you're cargo culting it, and not learning the point of the "xfvz" (it means eXtract, from the specified File, with a
by gfodor 11y ago
Why not just learn what the flags mean? If you're cargo culting it, and not learning the point of the "xfvz" (it means eXtract, from the specified File, with a Visual dump of the extraction, from a gZipped archived tarball) -- you'll never remember it.
- deleted 11y ago[deleted]
- adrusi 11y agoThe f isn't for force. It's for "file" and it takes the filename as a parameter — that's why you usually see it at the end of the character sequence, a filename has to immediately follow it. If you don't specify -f tar will read from stdin for extraction or write to stdout for creation.
- deleted 11y ago[deleted]
- SeldomSoup 11y agoSeems like a redundant flag. Many utilities are perfectly fine reading from stdin if no [file] is specified, without any kind of -f flag.
- adrusi 11y agoIt's redundant for extraction. For creation (-c) where you can list many files, it's just a choice some unix developer made to allow the destination file to be specified independent of order. I think there'd be some awkward edge cases otherwise. Anyway, adding verbosity to discourage operating on static files and prefering being on a pipeline could be considered a feature.
- Hello71 11y agono, "v" means verbose since at least 2.8 BSD: https://www.freebsd.org/cgi/man.cgi?query=tar&manpath=2.8+BSD https://www.freebsd.org/cgi/man.cgi?query=tar&manpath=2.8+BS...
- reedlaw 11y ago"tar xvzf" is already a part of my muscle memory. Occasionally I need to change the "z" to a "j" for bzip2 archives. And the "x" becomes a "c" if I'm Creating an archive rather than eXtracting. Also this site doesn't show the command for files with ".tgz" extensions.
- JoshTriplett 11y ago> tar xvzf" is already a part of my muscle memory. Occasionally I need to change the "z" to a "j" for bzip2 archives With modern tar, just don't include the z at all. "tar -xf" knows how to extract various kinds of compressed tar files automatically.
- monksy 11y agoToday I learned. I've been doing zxvf for quite a while and I always got annoyed with bz2 files.
- nstart 11y agoYeps. I used to have to keep googling whenever I wanted to extract something. Then I decided to learn what the flags meant and realised how easy it was. When doing the command it was a matter of saying it in head ("I am extracting from this gzipped file"). Likewise for compressing. Only difference being 'c' stood for Compressing.
- deciplex 11y agoYou adding a lot of extra words, and there are many other options to tar, and you've left out making an archive, but yeah: -cf Create File -xf eXtract File then you have the adverb v, and the adjective z: -vczf Verbosely Create gZip File -vxzf Verbosely eXtract gZip File I find it difficult to remember the arguments mostly because I seldom use tar, not because the arguments are unintuitive or something.