Created
June 5, 2018 07:04
-
-
Save xiaoysh8/ef24944a3d574a5c2916e287ccb299ff to your computer and use it in GitHub Desktop.
linux tar
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| tar -czvf name-of-archive.tar.gz /path/to/directory-or-file | |
| Here’s what those switches actually mean: | |
| -c: Create an archive. | |
| -z: Compress the archive with gzip. | |
| -v: Display progress in the terminal while creating the archive, also known as “verbose” mode. The v is always optional in these commands, but it’s helpful. | |
| -f: Allows you to specify the filename of the archive. | |
| tar -czvf archive.tar.gz /home/ubuntu --exclude=/home/ubuntu/Downloads --exclude=/home/ubuntu/.cache | |
| tar -czvf archive.tar.gz /home/ubuntu --exclude=*.mp4 | |
| tar -xzvf archive.tar.gz -C /tmp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment