Home > Bash Tip & Tricks, linux > How to remove all files generated by an extracted tar archive

How to remove all files generated by an extracted tar archive

December 24th, 2009 Leave a comment Go to comments

Often I use tar files downloaded from the internet, sometimes these files don't include a directory containing all other files and directories, so it's very tedious removing all files generated by the extraction, but I can use the following command to remove all the files generated:

# rm -f `tar ft file.tar`

# rm -f `tar ftz file.tar.gz`

if the tar archives contain also some directories I shall add the r option to the command line:

# rm -rf `tar ft file.tar`

# rm -rf `tar ftz file.tar.gz`

 

 

merry xmas,

gg1

Categories: Bash Tip & Tricks, linux Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.
*

Statistical data collected by Statpress SEOlution (blogcraft).