This is a directory structure:
I want to tar Directory1 with the conditions -
- It should include only those files that are modified in the last three days.
- Keep the directory structure intact.
The final tared output should be -
This is a directory structure:
I want to tar Directory1 with the conditions -
The final tared output should be -
Copyright © 2021 Jogjafile Inc.


-mtime -4d: find all files which were modified in less than 4 days(
-mtime 3dwill find all files which were modified exactly 72 hours 00 minutes 00 seconds ago – this is probably not what you are asking for)Please stay out of directory1 and directory2 while running this command.
Add
-zoption –tar -czf– if in addition to archiving the files, you also want to compress them.