Create TAR.gz
Simple TAR file of a Specific location
[oracle@server]$ tar -cvf file_name.tar.gz /home/d01/oracle
Create simple TAR file of a Specific Location & save on /home/oracle/backup/ folder
- c – creates a new archive
- v – verbose, meaning it lists the files it includes
- f – specifies the name of the file
Create compressed TAR file
Add the -z option to create a compressed GNUZIP file
[oracle@server]$ tar -cvzf file_name.tar.gz /home/d01/oracle
[oracle@server]$ tar -cvzf /home/oracle/backup/file_name.tar.gz /home/d01/oracle
Extract TAR file
You can unzip these files the same way you would unzip a regular zipped file:Extract TAR file
- x – instructs tar to extract the files from the zipped file
- v – to list out the files it’s extracting
- z – instructs tar to decompress the files
- f – tells tar the filename you want it to work on
Extract TAR file in specific /home/oracle/clone/db folder
[oracle@server]$ tar –xvzf documents.tar.gz –C
/home/oracle/clone/db/