6 ms·
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
by stack_underflow 6y 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.
- corpMaverick 6y agoExactly, these are the only ones I know and never get confused. Actually I use cvzf and xvzf.
- stjohnswarts 6y agoyou might want to at -p for preserving permissions in there are well, handy for archiving