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 06-15-2010, 04:54 AM   #1
shifter
Member
 
Registered: May 2006
Distribution: Slackware, DragonFly
Posts: 233

Rep: Reputation: 30
extract tar.gz file in other directories


I stay in /var/www/upload and I want extract a file with tar command.

The output of tar xfvz /var/www/file.tar.gz is

Quote:
tar: /var/www/esempio.tar.bz2: funzione "open" non riuscita: Nessun file o directory
tar: Errore irrimediabile: uscita immediata
tar: Child returned status 2
tar: Uscita con stato di fallimento in base agli errori precedenti
Where is the problem?
 
Old 06-15-2010, 05:02 AM   #2
tracertong
Member
 
Registered: Jun 2010
Posts: 34

Rep: Reputation: 16
My Italian isn't great, but doesn't that just say 'no such file or directory'? The path looks to be wrong. The file you talk of is a .gz, but the error you show is for a .bz2

Try using tab-completion when entering long paths to files, that's what I do. it helps eliminate typos.

Last edited by tracertong; 06-15-2010 at 05:03 AM.
 
Old 06-15-2010, 05:03 AM   #3
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by shifter View Post
I stay in /var/www/upload and I want extract a file with tar command.

The output of tar xfvz /var/www/file.tar.gz is



Where is the problem?
Code:
"tar: / var/www/esempio.tar.bz2: function "open" failed: No such file or directory tar: Error irretrievable: immediate exit tar: Child Returned status 2 tar: Output with bankrupt according to previous errors"
shouldnt this be

tar xvfj /var/www/upload/esempio.tar.bz2 ??

or are you saying you want to extract the zip file to /var/www/

Last edited by centosboy; 06-15-2010 at 05:08 AM.
 
Old 06-15-2010, 05:07 AM   #4
centosboy
Senior Member
 
Registered: May 2009
Location: london
Distribution: centos5
Posts: 1,137

Rep: Reputation: 116Reputation: 116
Quote:
Originally Posted by centosboy View Post
Code:
"tar: / var/www/esempio.tar.bz2: function "open" failed: No such file or directory tar: Error irretrievable: immediate exit tar: Child Returned status 2 tar: Output with bankrupt according to previous errors"
shouldnt this be

tar xvfz /var/www/upload/esempio.tar.bz2 ??

or are you saying you want to extract the zip file to /var/www/


If you want to extract tar file to another directory, then

Code:
tar xvfz file.tar.gz -C /new/directory
 
Old 06-15-2010, 05:09 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Code:
tar: /var/www/esempio.tar.bz2: funzione "open" non riuscita: Nessun file o directory
Actually you tried to extract a bzip2 file, that most likely does not exist. Furthermore the -z option of tar is specific for gzip files, whereas -j manages bzip2. Anyway, GNU tar can manage both the compression methods without specifying any of the two options: it guesses the right method from the file type.
 
  


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
extract file from tar ust Linux - Newbie 8 03-31-2009 08:23 AM
how to extract tar.gz file ???/ wahaha Linux - Software 6 10-27-2007 09:33 AM
extract tar.gz file manolakis Linux - Newbie 3 11-13-2006 11:49 AM
can not extract the tar.gz file sharad durgawad Linux - Software 3 10-05-2005 03:41 AM
How to extract a tar.gz file? deWin Linux - Newbie 3 11-10-2004 12:24 PM


All times are GMT -5. The time now is 10:30 PM.

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