FG
💻 Software

How can I force only relative paths in "find" output?

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

Problem

I am attempting to create a script that can compress files with a certain extension in a number of directories into a single tar-ball. Currently what I have in the script file is: Where is the base path to search. This is fine except the paths are absolute in the tar file. I would prefer the paths …

Error Output

find "$rootDir" -name '*doc' -exec tar rvf docs.tar {} \;

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How can I force only relative paths in "find" output?

Low Risk

You can use the format in the directive: will display in your example: You may then use this list in a expression, in order to run our exec command, as in:

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment