LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Listing directories only from tar file? (https://www.linuxquestions.org/questions/linux-newbie-8/listing-directories-only-from-tar-file-500874/)

Ion42 11-12-2006 10:57 AM

Listing directories only from tar file?
 
I have a rather large (~31 GB) tar file, a backup of /home on a server.
What i want to do i list the contents of this file but only the directories.

I know that "tar -tvf backup.tar" lists all the files but i don't know how to make it list only the directories.

Anybody have any good advice?

matthewg42 11-12-2006 11:07 AM

Just append this to your existing command (which already has the v (verbose) and t (list) options:
Code:

|grep ^d

Ion42 11-12-2006 11:27 AM

Thanks a lot :)


All times are GMT -5. The time now is 04:14 AM.