cli-tarHow do I create a Unix tar archive with a password?
Creating a Unix tar archive with a password is done using the tar command in combination with the gpg command.
The following example code will create a tar archive named archive.tar
and encrypt it with a password password
:
tar -cvf archive.tar file1 file2
gpg -c --cipher-algo AES256 archive.tar
The output of the command should be:
Enter passphrase:
Repeat passphrase:
The code has the following parts:
tar -cvf archive.tar file1 file2
: This creates a tar archive namedarchive.tar
containing the filesfile1
andfile2
.gpg -c --cipher-algo AES256 archive.tar
: This command encrypts the tar archivearchive.tar
using the AES256 algorithm and prompts the user for a passphrase.
Helpful links
More of Cli Tar
- How do I use the Unix tar zip command?
- How do I use the shell to tar and zip files?
- How do I use the command line to tar and zip a file?
- How do I use gzip, tar, and zip to compress files?
- How do I use the command line to tar and zip files?
- How can I use tar commands to zip a file?
- How do I use the command line to tar and distribute files?
- How do I create a tar.zip file in Unix?
- How do I use the Unix tar xvf command to extract files?
- How do I use the command line to tar and zip a file?
See more codes...