Thursday, 5 October 2017

How to Extract Tar Files to Specific or Different Directory in Linux



Extract a tar archive to a different directory using tar command on a Linux. We can do this using the following command where we want to the files to reside.


The syntax of tar utility for extracting files to a different directory:

[root@linuxcnf ~]# tar -xf file_name.tar -C /target/directory
[root@linuxcnf ~]# tar -xf file_name.tar.gz --directory /target/directory


No comments:

Post a Comment