Linux CLI - Archiving and Compression
Which command creates an xz compressed archive of the
logs directory including only files modified within the last 7 days?logs directory including only files modified within the last 7 days?find with -mtime -7 to select files modified within 7 days, then passes them to tar with --null and -T - to read null-separated filenames.--newer-mtime which is not a standard tar option. tar -cJf logs.tar.xz logs --exclude='*' --include='*7days*' uses invalid --include and --exclude patterns. find logs -mtime +7 | tar -cJf logs.tar.xz -T - finds files modified more than 7 days ago, opposite of requirement.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions