Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> tar

I remember only two flags for tar. That's it.

  tar -x
  tar -c
c for create, x for extract.

I use it like so:

  tar -c src | gzip > src.tar.gz
and extracting like

  curl https://source.code/src.tar.gz | gunzip | tar -x
That's all.

The core operations taking up only this much headspace leaves the door open to slowly start to retain all its other useful options. For example, -v, which means verbose almost everywhere, thankfully means verbose here too, so I add that when I want verbosity.

Similarly, I find it easy to retain -l which lists the contents. I do this quite often for stuff from the internet -- I don't like it when I untargz in ~/Downloads and it untargz's it in the same directory instead of doing everything inside a parent directory (preferably with the same name as the archive)

Bonus: separating out the gzip like this makes it easy to remember how to use zstd if you want to, just pipe to zstd instead! "Unix philosophy" and all that.

I agree with you about `ln`, I can never seem to remember if it's source or target that comes first.



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: