Linux Tarball Directories Question

Stupid question -

I know how to recursively tarball a directory when I'm in the directory chain right above it...

like say I'm in


and I want to tarball /var/www/httpdocs

I know how to do that.  But - say I don't want the tarball to start with the httpdocs directory...and just want to tarball up everything "from where I am."

So I go into /var/www/httpdocs and tarball from within there...what's the syntax for that?

Who is Participating?
woolmilkporcConnect With a Mentor Commented:
tar -cvf /path/to/ball.tar .

Note the dot (" .") at the end. It stands for the current directory.

käµfm³d 👽Connect With a Mentor Commented:
So you wish to create a tarbomb?
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.

All Courses

From novice to tech pro — start learning today.