Tarball Decompression/Directory Question

Posted on 2013-10-14
Medium Priority
Last Modified: 2013-10-29
Probably a stupid question - but I just know the basics about Linux/SSH/etc.

I've got a tarball with a series of directories packaged up in it.  The person who gzipped it up just did a recursive packaging...from a primary directory.

So it's like...


When decompressing it - I don't want the httpdocs initial directory...

Any way for me to un-package it so it does all the contents w/o dumping it into an httpdocs directory?

Thanks in advance!
Question by:erzoolander
1 Comment
LVL 20

Accepted Solution

simon3270 earned 2000 total points
ID: 39573256
I don't think that there is an easy way to do this in tar, but could you do
tar xf filename.tar
mv -f httpdocs/* .
rmdir httpdocs

Open in new window

(this assumes that you don't already have an httpdocs directory.  if you do, precede the commands with
    mv httpdocs httpdocs.safe
and follow them with
    mv httpdocs.safe httpdocs

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
This article will show you step-by-step instructions to build your own NTP CentOS server.  The network diagram shows the best practice to setup the NTP server farm for redundancy.  This article also serves as your NTP server documentation.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

624 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question