I wish to extract /tmp/moht/104.tar
to /tmp/moht/
directory
ls -ltr /tmp/moht/104.tar
-rwxrwxr-x 1 meadmin meadmin 933498880 Jan 5 07:03 /tmp/moht/104.tar
I tried the below commands, but it does not extract to /tmp/moht/
directory.
It does not even print any output for extraction despite me using the -v
option with tar
command.
Below is everything I tried.
tar -xvf 104.tar --directory /tmp/moht/
tar -zvxf 104.tar --directory /tmp/moht/
tar -zvxf 104.tar -C /tmp/moht/
tar -jvxf 104.tar -C /tmp/moht/
If I cd /tmp/moht
and fire this command tar -xf 104.tar
then the files get extracted alright.
I'm using Sun Solaris Sparc. I do not wish to cd but give absolute path for both the tar file as well as the destination. I am not using GNU tar, but the tar that comes with Solaris.
This will be a part of a script so all the filenames and paths will be changed to variables; hence my requirement is very specific. Can you please suggest?
tar xC /tmp/moht -f /tmp/moht/104.tar tar: C: unknown function modifier
– Ashar Jan 05 '21 at 14:04cd
is the only option … Do you agree ? – Ashar Jan 05 '21 at 14:06