Hacker News new | ask | show | jobs
by stack_underflow 2098 days ago
These two commands should fit most of your use cases:

  tar cf dir.tar dir          # mnemonic: 'create file' <tar-file-name> <dir-to-tar>
  tar xf dir.tar(.gz|bz2|...) # mnemonic: 'eXtract file' <tar-file-name>
On systems with "modern" versions of tar `-x` is capable of recognizing which compression format is used and doesn't require the explicit `-j/z` flags you usually see.
1 comments

Exactly, these are the only ones I know and never get confused. Actually I use cvzf and xvzf.
you might want to at -p for preserving permissions in there are well, handy for archiving