Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the rank-math domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/u763016847/domains/golinuxhub.com/public_html/wp-includes/functions.php on line 6114
How to extract files to different directory using tar in Unix/Linux - GoLinuxHub

How to extract files to different directory using tar in Unix/Linux

Most of us extract the compressed file in the same directory but what if you get into a situation you need to extract it at some other location?
You just need to add one extra argument

# tar -xzvf file.tar.gz -C /destination/path

For eg

# pwd
/home
# tar -czvf test.tar.gz test/

So, now our test directory is compressed. let us extract it inside /tmp staying under /home

[root@test home]# tar -xzvf test.tar.gz -C /tmp/
# cd /tmp
# ls -l
drwx------. 4 test test 4096 Sep 28 12:46 test

Easy and simple. Let me know your success and failures
Related Articles
How to unlink/delete a symbolic in Linux
How to preserve Symbolic links with tar command in Unix/Linux
How to create Soft Link and Hard Link in Linux