Thursday, 28 September 2017

Tar a directory in Linux Server

Archive a File or Directory
=====================================

tar -czvf name-of-archive.tar.gz /path/to/directory-or-file

  • -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.


If no compression required (i.e., no gzip)
----------------------------------------
tar -cvf name-of-archive.tar.gz /path/to/directory-or-file


Multiple Directories at a time
--------------------------------------
tar -czvf archive.tar.gz /u01/app  /u01/appv2/tnslatest.txt


Exclude any files or directories
----------------------------------
tar -czvf name-of-archive.tar.gz /u01/app --exclude=/u01/app/oracle/backups --exclude=/u01/app/oracle/Middleware/BI_bkp

tar -czvf name-of-archive.tar.gz /u01/app --exclude=*.txt


Extract the Archive
=================================

Just replace "-c" switch with "-x" switch

tar -xzvf name-of-archive.tar.gz /path/to/directory-or-file


No comments:

Post a Comment

Obiee CSV Export Limit Change

Issue Description: When we export a Report in CSV  format in Obiee11g, by default it will export 65,000 rows. Even if we increase the b...