in reply to listing files in tar archive, with depth 1
Getting a list of all files seems fine to me. Either way, you'd have to read all of the tar archive to find all the deep 1 filenames.
You could use tar -t --exclude="*/*" from command-line to get only the depth one names, at least if you have GNU tar – but note that there need not be any such filename: the archive can contain files under some directory but not the directory itself.
Update: if you're planning to extract the archive, it might be easier to extract it to a subdirectory first, then look at what files got created in that subdirectory, then move them to their final location.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: listing files in tar archive, with depth 1
by loituma (Initiate) on Jun 23, 2011 at 19:49 UTC |