LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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 08-12-2008, 04:12 AM   #1
shipon_97
Member
 
Registered: Oct 2005
Location: Bangladesh
Posts: 504

Rep: Reputation: 31
Cool Cannot uninstall .tar/.bz2 file


Dear Friends

I have to install a tar file following way :

tar -xvf file1.tar
or
tar -jxvf file1.tar.bz2

But I dont know How to uninstall it ? Can anybody plz tell me how can I
uninstall tar file ?
 
Old 08-12-2008, 04:18 AM   #2
indeliblestamp
Member
 
Registered: Feb 2006
Distribution: Fedora
Posts: 341
Blog Entries: 3

Rep: Reputation: 40
tar will only extract the files to the same path that it was initially tarred from. e.g. If your files/folders are untarred to a new folder in the current working directory (this is usually the case), you can safely delete them as long as you have the tar file safe.
 
Old 08-12-2008, 04:19 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
The command doesn't install a package. It justs expands the file. Most tarballs will expand into a directory, so you just need to delete that directory and all files in it.

If you have a tar file with a number of files that were extracted in the current directory, you can list the files in the original tarball with "tar --list -jf tar1.tar.bz2". The file list can be used to delete the files:
tar --list -jf tar1.tar.bz2 | tr '\n' '\0' | xargs -0 rm -v

The "tr" command will replace returns with the null character. The -0 option of xargs will use the null character to separate arguments. This is needed if the file names contain white space.
 
Old 08-12-2008, 04:25 AM   #4
prakash.akumalla
Member
 
Registered: Jun 2008
Location: India
Posts: 109

Rep: Reputation: 15
Hi,
The command you used is to extract files from a tar ball. That command will create a directory which is a set of files or directories which are made as a tar ball.

To make the action of the above command nullify you just need to delete the directory.
You can use rmdir command for that if the directory is empty.
Else use

rm -rf directory_name

this will completely deletes the directory no maters how many other directories and files that directory contains.

Prakash.
 
  


Reply



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
Piping tar bzcat to add a file to a tar.bz2 archive DaveQB Linux - Software 0 06-02-2008 08:28 PM
Why can't I install a *.tar.gz or a *.tar.bz2 file? SkinnerC Slackware 11 12-13-2007 10:03 AM
'Read-only file system' when untar a tar.bz2 file yinglcs Linux - General 1 02-18-2006 09:12 PM
Opening of a tar.bz2 file Gins Linux - General 8 04-08-2005 03:42 PM
problem unzipping a tar.bz2 file tar: Error is not recov jyome Linux - Software 4 09-04-2003 01:04 PM

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

All times are GMT -5. The time now is 12:33 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
Open Source Consulting | Domain Registration