![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Search for a string and copy the entire line | forumthreads | UNIX for Dummies Questions & Answers | 1 | 06-22-2007 07:20 AM |
| Copy / string. | Paulw0t | Shell Programming and Scripting | 6 | 03-10-2007 07:26 PM |
| Search a string from list of input files | sivakumarvenkat | UNIX for Dummies Questions & Answers | 2 | 03-08-2006 02:08 PM |
| copy and rename list of files | kinmak | UNIX for Dummies Questions & Answers | 7 | 02-27-2005 05:23 PM |
| find and copy string in a file | vascobrito | UNIX for Advanced & Expert Users | 10 | 03-03-2004 10:14 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
How to List and copy the files containing a string
I have more than 8000 files in a dir, I need to copy to other dir which containing the "sample" I tried grep -il "1189609240791-1268115603299237276@216.109.111.119 ' | cp /tmp/inv Nothing is happening for long time for 100 file dir too, Any one can help me? |
| Forum Sponsor | ||
|
|
|
|||
|
Quote:
ctlrws001[/tmp/inv1]$ cp $(grep -l "1190151616066-4284832706333417688@216.109.111.119') /tmp/inv/test > ctlrws001[/tmp/inv1]$ grep -l "1190151616066-4284832706333417688@216.109.111.119 > |
|
||||
|
Quote:
|
|
||||
|
Just curious, I tried this:
Code:
zsh 4.3.4% for i ({1..400000}) touch "$i".txt
Code:
zsh 4.3.4% rm *txt zsh: argument list too long: rm zsh 4.3.4% autoload zargs zsh 4.3.4% zargs *txt rm -- zargs:168: subscript too big: 397905 zsh 4.3.4% while :;do rm *.txt([1,20000]);done zsh: argument list too long: rm Code:
while :;do rm *.txt([1,10000]);done |
||||
| Google UNIX.COM |