5 ms·
Nearly everything that packs or unpacks stuff. tar, gunzip, and else. I can never remember if they are going to unpack everything into a subdirectory or spill e
by urxvtcd 5y ago
Nearly everything that packs or unpacks stuff. tar, gunzip, and else. I can never remember if they are going to unpack everything into a subdirectory or spill everything into my home, and conversely I never know if after zipping there's gonna be a directory inside or not. Luckily dtrx and atool do the thing you want most of the time.
From the time I was a teen I think I remember that mount was difficult to use, and mounting a CD image required passing some arcane options, though maybe I just didn't know how to use it (on the other hand I didn't know how to use Daemon Tools either, and it just worked).
I don't have a problem with git though. I don't think it's the command-line interface that's hostile, it's git itself if you don't know what you're doing. After taking some time to learn it I actually enjoy solving difficult problems with git.
- DanielVZ 5y agoYeah, extractors/compressors are so bad i ended up hacking my own interface over the common utilities in python (i called it tzar because it's tar, zip, anything really).
- LittlePeter 5y agoRelevant xkcd comic: https://xkcd.com/1168/ https://xkcd.com/1168/
- rspoerri 5y agotar -czf ./file.tgz ./* edit: i do hope that is correct without checking :-)
- urxvtcd 5y agoSo the dash in `-czf` if optional? Which reminds me: why does ps have two sets of options again?
- atsaloli 5y agoDon't laugh, it's actually three sets of options now: - UNIX options, which may be grouped and must be preceded by a dash. - BSD options, which may be grouped and must not be used with a dash. - GNU long options, which are preceded by two dashes. Reference: https://man7.org/linux/man-pages/man1/ps.1.html https://man7.org/linux/man-pages/man1/ps.1.html
- cozzyd 5y agotar --version
- Zababa 5y agoThat's something I never understood. I learned tar -xvf young, and that's the only command I've ever used, and it works every time.
- simonh 5y agoI interpreted the comic as meaning not any old tar command line, but a command line for a specific intended purpose. I had a job interview once with a test consisting of a whole list of 20 unix questions, one of which was "you need to do x, y and z in tar, what's the command line?". I got about 5 of them, but spent the 5 minutes critiquing the test and suggesting ways to improve it. I got the job. Apparently my 5 answers were the best anybody got anyway.
- thunderbong 5y agoThis is a pain in the GUI tools as well
- tombl 5y agoAs an alternative to atool I've always used The Unarchiver's cli version[0] which has been able to handle basically anything I've thrown at it correctly. [0]: https://theunarchiver.com/command-line https://theunarchiver.com/command-line
- Ristovski 5y agoA very handy tool for this is https://www.nongnu.org/atool/ https://www.nongnu.org/atool/
- doteka 5y agoLong ago someone taught me this memory trick for tar: imagine an angry German stereotype saying “eXtract Ze Vucking File”, thus -xzvf. No idea what it stands for but it does what I need most of the time.
- timbit42 5y agox = extract, z = compress/decompress, v = verbose (list files added or extracted), f = filename follows. You can leave off the 'z' if it's a tar without compression. If it's compressed, the extension is usually tgz, tar.Z, bz2, or something else other than tar. You can leave off the 'v' if you don't want to see a list of which files are being added or extracted.
- mvkg 5y agoIn recent versions of (maybe only GNU?) `tar` you can leave off the `z` flag and it will still decompress based on the filename.
- PenguinCoder 5y agoOr just replace the z with an a. That's what I mainly use.
- jquast 5y agoMay I suggest to use “zipinfo” or “tar -t” to check the contents of the archive before extracting