UNIX command

If it doesn't fit in another category, ask it here.
Post Reply
Posts: 1
Joined: 2007/01/29 16:53:25

UNIX command

Post by jyteh » 2007/01/29 17:04:18

Hello All,

I would like to create a tar archive for all files with extension *.htm only under a directory ( including of the *.htm files under directories of the directory). May I know the command line should I key in ?

I just wonder on how to use the tar command with find command where I can search for files with *.htm with command "find directory -name \*.htm".
Kindly advise.


Posts: 2629
Joined: 2007/01/07 02:18:02
Location: Central IL USA

UNIX command

Post by pjwelsh » 2007/01/29 17:23:05

Try something like:
[quote]find . -type f -name "*.html" | xargs tar rvf /YOUR/TAR/FILE.tar[/quote]

Is the easy command line "quickie"

Post Reply

Return to “CentOS 4 - Miscellaneous Questions”