You are not logged in.

#1 2010-01-20 22:12:04

pr0l1f1k
Member
Registered: 2009-08-02
Posts: 30

how to extract files in terminal[solved]

im trying to install themes and when i download the file i need to extract it and unless i switch to root in terminal i dont have permission to extract it to /usr/share/themes. so what code do i need to use tto exract files in terminal?

Last edited by pr0l1f1k (2010-01-21 01:10:45)

Offline

#2 2010-01-20 22:22:57

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: how to extract files in terminal[solved]

"tar" for tar.gz, tgz, tar.bz2, and tbz2 files. "unzip" for zip files.

Offline

#3 2010-01-20 22:49:05

Surgat_
Member
Registered: 2007-08-08
Posts: 317

Re: how to extract files in terminal[solved]

You shouldn't be able to extract anything to /usr/share/themes as a non-root user, as that's a system directory only writeable by root. You can either install them as root (that installs the themes for every user) or extract them to ~/.themes/, and thus installing them only for your user.

Offline

#4 2010-01-20 22:54:06

pr0l1f1k
Member
Registered: 2009-08-02
Posts: 30

Re: how to extract files in terminal[solved]

ya i was  going to use su - root than do it.

Offline

#5 2010-01-20 23:04:13

pr0l1f1k
Member
Registered: 2009-08-02
Posts: 30

Re: how to extract files in terminal[solved]

so i did su - root
than typed in my password

and tried tar -xf file:///home/ferrath/Downloads/90873-axiom-gtk.tar.gz
/usr/share/themes
and get this

[root@ferrathnetbook ~]#  tar -xf file:///home/ferrath/Downloads/90873-axiom-gtk.tar.gz
tar: file\:///home/ferrath/Downloads/90873-axiom-gtk.tar.gz: Cannot open: Input/output error
tar: Error is not recoverable: exiting now

i dont understand what im doing wrong.

Offline

#6 2010-01-20 23:07:47

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: how to extract files in terminal[solved]

Don't do that.
Just do this,
tar xvf ~/Downloads/whatever.tar.gz -C /usr/share/themes/


neutral

Offline

#7 2010-01-20 23:11:33

pr0l1f1k
Member
Registered: 2009-08-02
Posts: 30

Re: how to extract files in terminal[solved]

okay ill give it a try, just for a note, what does the ~ represent?

Offline

#8 2010-01-20 23:17:53

Vintendo
Member
From: Netherlands
Registered: 2008-04-21
Posts: 375
Website

Re: how to extract files in terminal[solved]

Your own home folder, so in your case /home/ferrath

Offline

#9 2010-01-20 23:18:16

pr0l1f1k
Member
Registered: 2009-08-02
Posts: 30

Re: how to extract files in terminal[solved]

[root@ferrathnetbook ~]# tar xvf ~/downloads/90873-axiom-gtk.tar.gz -C /usr/share/themes/
tar: /root/downloads/90873-axiom-gtk.tar.gz: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

this is what i got while trying.

Offline

#10 2010-01-20 23:34:44

urist
Member
Registered: 2009-02-22
Posts: 248

Re: how to extract files in terminal[solved]

If you downloaded it as a user, it's in your user's home directory somewhere. If you su to root, ~ will point to /root/ instead of /home/ferrath/

Offline

#11 2010-01-20 23:37:18

Vintendo
Member
From: Netherlands
Registered: 2008-04-21
Posts: 375
Website

Re: how to extract files in terminal[solved]

Try: tar xvf /home/ferrath/downloads/90873-axiom-gtk.tar.gz -C /usr/share/themes/

Because you were root, your home folder is /root/. I think sand_man assumed you were using sudo, which uses your settings, so among others your home folder.

Offline

#12 2010-01-21 00:10:45

pr0l1f1k
Member
Registered: 2009-08-02
Posts: 30

Re: how to extract files in terminal[solved]

I still get the erro:nosuch file or directory, when i do what vintendo said to.

Offline

#13 2010-01-21 00:34:21

Mardoct
Member
Registered: 2009-08-17
Posts: 208

Re: how to extract files in terminal[solved]

Well if you don't mind foregoing convention and the workstation is only for your use, you could just make /usr/share/ writeable to all.

# chmod -R 555 /usr/share

Also make sure that you have the *exact* path to your file, and remember it is case sensitive. If it says the file isn't found, it simply means that the path you've given isn't valid.


The human being created civilization not because of willingness but of a need to be assimilated into higher orders of structure and meaning.

Offline

#14 2010-01-21 00:44:12

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: how to extract files in terminal[solved]

*sigh* tar xvzf
It's a gzipped tar-file!

Offline

#15 2010-01-21 00:59:07

pr0l1f1k
Member
Registered: 2009-08-02
Posts: 30

Re: how to extract files in terminal[solved]

okay i got it, thanks a lot guys.

*edit* actually i have another question. my screen seems really dark, how can i increase the brightness of it? its an asus eeepc 900a netbook

Last edited by pr0l1f1k (2010-01-21 00:59:50)

Offline

#16 2010-01-21 01:10:25

pr0l1f1k
Member
Registered: 2009-08-02
Posts: 30

Re: how to extract files in terminal[solved]

or nevermind. rofl stupid mistake. got it. thanks guys.

Offline

#17 2010-01-21 01:21:59

sausageandeggs
Member
Registered: 2009-12-05
Posts: 66

Re: how to extract files in terminal[solved]

Also heres a handy little function that makes it easy to extract files from CLI if you cant remember the cmds. I have it in my /etc/bash.bashrc so it works for all users. Type "extract foo.bar" to extract. You might also need to install unzip,unrar or others.

 extract () {
  if [ -f $1 ] ; then
    case $1 in
      *.tar.bz2)   tar xvjf $1    ;;
      *.tar.gz)    tar xvzf $1    ;;
      *.tar.xz)    tar xvJf $1    ;;
      *.bz2)       bunzip2 $1     ;;
      *.rar)       unrar x $1     ;;
      *.gz)        gunzip $1      ;;
      *.tar)       tar xvf $1     ;;
      *.tbz2)      tar xvjf $1    ;;
      *.tgz)       tar xvzf $1    ;;
      *.zip)       unzip $1       ;;
      *.Z)         uncompress $1  ;;
      *.7z)        7z x $1        ;;
      *.xz)        unxz $1        ;;
      *.exe)       cabextract $1  ;;
      *)           echo "\`$1': unrecognized file compression" ;;
    esac
  else
    echo "\`$1' is not a valid file"
  fi
}

Offline

#18 2010-01-21 01:56:38

sand_man
Member
From: Australia
Registered: 2008-06-10
Posts: 2,164

Re: how to extract files in terminal[solved]

One post there is a 'D' in Download in your path, the next you have a 'd'. That's why it said, file not found.
You should get used to using tab completion.


neutral

Offline

#19 2010-01-21 02:50:23

Misfit138
Misfit Emeritus
From: USA
Registered: 2006-11-27
Posts: 4,189

Re: how to extract files in terminal[solved]

perbh wrote:

*sigh* tar xvzf
It's a gzipped tar-file!

Hehe...all you need is tar xvf; tar reliably guesses which compression algorithm is used. :)

Offline

#20 2010-01-21 05:21:36

perbh
Member
From: Republic of Texas
Registered: 2005-03-04
Posts: 765

Re: how to extract files in terminal[solved]

duh!! One learns something new every day!

... and howdy - btw (@Misfit)

Offline

Board footer

Powered by FluxBB