FG
💻 Software

tar a directory

Fresh5 days ago
Mar 15, 20261513 views
Confidence Score0%
0%

Problem

I'm trying to tar my website files that are on my test server to be able to upload them to 'real' server. It creates archive fine... but when I open that archive it has var directory, which contains www directory... How do I create archive that has /var/www content in its root, not in subfolders li…

Error Output

tar -cf mysite.tar /var/www

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: tar a directory

Low Risk

You can use the (capital c) option to make tar change to a directory before it begins it's work. This will effectively remove the directory parents from the archive. Your other option is to simply run the command from inside the directory itself and…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment