The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
[ HOME | TOPICS | INDEX | WEB RESOURCES | BOOKS | CONTRIBUTE | SEARCH | FEEDBACK | FAQ | FORUMS ]
Scripts / handy tips
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Previous Message  |  Next Message 
 tar all files matching
Author: Dan 
Date:   19-01-12 23:49

This grabs me all the files that match strings contained within ~/tmp/msgs and puts them in ~/msgs.tar

The match actually looks for the second field in the file.. this just suits the diff I get... adjust for your needs.

[dan@ngaio:~/FreshPorts/freshports.org/msgs/FreeBSD/recent] $ tar -cf ~/msgs.tar `cat ~/tmp/msgs | awk '{print $2}' | egrep -lf - *.raw`

--
Webmaster

 Reply To This Message  |  Forum List  |  Flat View   Newer Topic  |  Older Topic 

 Topics Author  Date
 tar all files matching   new
Dan 19-01-12 23:49 


 Forum List  |  Need a Login? Register Here 
 User Login
 User Name:
 Password:
 Remember my login:
   
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum

phorum.org