PDA

View Full Version : untar file to specified directory


jon zendatta
October 17th, 2009, 05:41 PM
hell0
I am building a file that first requires dependencies to reside in Src directory. Currently they are tarred and are residing in Desktop. So I tried this!
cd ~/Desktop
tar -xzvf file.tar.gz -C /usr/src/

which threw an error!

So is this the correct command?

tar -C /usr/src/ -xzvf file.tar.gz

cheers for any help.

sisco311
October 17th, 2009, 05:46 PM
So is this the correct command?

tar -C /usr/src/ -xzvf file.tar.gz

cheers for any help.

yep

jon zendatta
October 17th, 2009, 05:53 PM
cheers for that, I'm bit cautious with this.Translate > I don't really understand it. all good now.

sisco311
October 17th, 2009, 05:54 PM
oh, add your user to the src group. /usr/src is owned by root.src and the direcoty has 2775 (drwxrwsr-x setguid (http://en.wikipedia.org/wiki/Setuid#setgid_on_directories)) permissions.

Bachstelze
October 17th, 2009, 05:59 PM
The correct command was the first one. Make sure you have permission to write to /usr/src, either by running the command with sudo or by adding yourself to the src group.

jon zendatta
October 17th, 2009, 10:02 PM
true:KS

jon zendatta
October 17th, 2009, 10:11 PM
0k you said my first command was correct, so i used it with sudo. then when i try
cd file
it says no file or directory? Any enlightenment please. I have to got out for 2hours so I'll look later. thank you

Bachstelze
October 17th, 2009, 10:20 PM
0k you said my first command was correct, so i used it with sudo. then when i try
cd file
it says no file or directory? Any enlightenment please. I have to got out for 2hours so I'll look later. thank you

You said you wanted to extract it into /usr/src, so that's where you need to look. ;)

jon zendatta
October 18th, 2009, 12:21 AM
yes you are correct, it now has a new home in /usr/src/
thank you:KS

jon zendatta
October 18th, 2009, 12:31 AM
0k. just one more question please? I was able to check the file existed in desired directory using
ls -la /usr/src
then change to that directory like so:
cd /usr/src
So now what command do I use to cd to that specific file so i can ./configure && make install

thanks for your patience:KS

jon zendatta
October 18th, 2009, 01:02 AM
forget the last question thanks, I have files installed :KS