LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-21-2006, 11:30 PM   #1
matt kramer
LQ Newbie
 
Registered: Jul 2006
Distribution: Mandrake
Posts: 29

Rep: Reputation: 15
problems with tar


hello

i've been trying to extract a tar file that i downloaded into a specific file that is only permissable by root. so i logged into the terminal as root and tried to extract the file to the inteded file and found that when i try to extract any tar file the terminal just hangs there without doing anything except just blink the curser at me on an empty line.

got any ideas about what's goin' on?


also, is there any way to run my GUI as the root user? i don't have the option to log into any of my gui's as root but i want to.

Last edited by matt kramer; 07-21-2006 at 11:32 PM.
 
Old 07-21-2006, 11:39 PM   #2
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 3,120

Rep: Reputation: 549Reputation: 549Reputation: 549Reputation: 549Reputation: 549Reputation: 549
I'll take the last comment first. Do not log into your x server as root. Although this is possible, it is silly. You can really do some damage logging into the xserver as root. Tar is not that complicate of a command. As far as I know you can't change permissions with tar. Usually you don't download a tar file. It is either .tar.gz or .tar.bz2. I don't know what exact command you are using, but to extract a .tar.gzfile:

tar zxvf file.tar.gz

For .tar.bz2:

tar jxvf file.tar.bz2

plain .tar

tar xvf file.tar

If you want a file name, other than the original:

mv file.tar.gz newfilename

To make this accesible only by root:

chown root: newfilename
chmod 0700 newfilename

Last edited by AwesomeMachine; 07-21-2006 at 11:40 PM.
 
Old 07-22-2006, 01:02 AM   #3
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
hello matt kramer

you can try doing this:

Code:
IFS=$'\n'; for a in $(tar -zxvf yourfile.tar.gz); do chmod root "$a"; done; IFS=$' :\t\n'
regards
 
Old 07-22-2006, 01:42 PM   #4
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 76
For GUI as root, try text-mode init (usually runlevel 3). Then login as root. Then do `startx'.
 
Old 07-22-2006, 07:45 PM   #5
konsolebox
Senior Member
 
Registered: Oct 2005
Distribution: Gentoo, Slackware, LFS
Posts: 2,248
Blog Entries: 8

Rep: Reputation: 235Reputation: 235Reputation: 235
have you tried sudo?

make this script

Code:
#!/bin/bash

FILE="$@"

IFS=$'\n'
for a in $(tar -zxvf "${FILE}"); do
   chmod root "$a"
done
IFS=$' :\t\n'
then do
Code:
sudo bash extractasroot.sh filename.tar.gz
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
tar tar cvf - . | (cd /root/; tar xvf -) ewt3y Linux - General 10 02-19-2014 11:55 AM
installation problems with libxml2-2.2.66.tar.gz and libxml2-devel2-2.6.20-3.tar.gz g-string 3 Linux - Software 6 11-24-2005 12:39 PM
.tar.gz problems piggysmile Linux - Software 1 05-31-2004 05:35 AM
Diferance between rpm, tar, tar.gz, scr.tar, etc mobassir Linux - General 12 08-21-2003 07:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:11 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration