Extract backup.tar.gz into a directory restore_dir and list its contents. (Use tar -xvf and ls)

1 min read
Step 1: Create a Directory for Extraction
bashCopyEditmkdir restore_dir
Step 2: Extract backup.tar.gz
into restore_dir
bashCopyEdittar -xvf backup.tar.gz -C restore_dir
x
→ Extract filesv
→ Verbose mode (shows files being extracted)f
→ Specifies the archive filename-C restore_dir
→ Extracts files intorestore_dir
Step 3: List the Contents of restore_dir
bashCopyEditls -l restore_dir
- This should show
backup_dir
insiderestore_dir
.
Step 4: List Extracted Files in backup_dir
bashCopyEditls -l restore_dir/backup_dir
- This displays the original files inside
backup_dir
.
Now you've successfully extracted backup.tar.gz
into restore_dir
and verified its contents!
0
Subscribe to my newsletter
Read articles from Ravi Vishwakarma directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
