R Language Extracting and Listing Files in Compressed Archives Listing files in a .tar archive

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Extensions
> Step 2: And Like the video. BONUS: You can also share it!

Example

Listing files in a tar archive is done with untar function from the utils package (which is included in base R).

untar(zipfile = "bar.tar", list = TRUE)

This will list all files in "bar.tar" and extract none. Tilde expansion is done automatically from your working directory. Alternatively, you can pass the whole path name to the tarfile.



Got any R Language Question?