using tar --list --file=x
will list all files and folders.
I am just looking to list the top level files and folders
does anyone know how to do that?
alternatively, does anyone know how to list only the top level files, but all folders including subfolders? Maybe with grep somehow?
update: looking for something that works on most nix flavors including MacOS.
Best Answer
The following method works for me to show only the top level files and directory names,
The following method shows one more level,
Directories are listed with a trailing slash.
If the list does not start with a dot or slash, you should use another pattern, for example
for only the top level directory and
for one more level.