Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

redirected output out of control



John Kirby wrote:
> Hi BLU,
> 
> Maybe this is a newbie error and I've been lucky not to encounter it before, 
> but your feedback is appreciated.
> 
> I ran a command and unintentionally created an enormous text file that ate up 
> all the gigs of open space on the server:
> find -print0 | xargs -0 grep -i blah > blahInstances.txt
> 
> I'm puzzled because when I ran the output to the screen, it was only something 
> like 1000 lines and it quit like I expected. What's also strange to me is 
> that I ran the command on my local suse 9.3 box and it didn't get caught up 
> and generate a huge file. It ran as expected. Not sure exactly what OS 
> version is on the machine that had the issue.
> 
> My main confusion is why running output to the screen would be fine, but 
> running it to the file would get caught in a loop or something similar.

Some commands do act differently when stdout is not a console.  I don't
think grep is one of them.

But the obvious thing to do here is to look at the top 100 and bottom
100 lines of the file, and look at the top 100 and bottom 100 lines of
console output, and find out what's different.  *Then* figure out why.




BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org