On Wed, 22 Jan 2003, Cory Petkovsek wrote:
> 
> What' Q+D?  

Quick and dirty, the find command you pushed out would execute faster, and
I think you can actually put the mv into the find command
(fewer processes spawned)

but if you just want to get it done it's sometimes better to use something
that fits in your head ;-) 

> 
> Cory
> 
> 
> On Wed, Jan 22, 2003 at 11:57:21AM -0800, Larry Price wrote:
> > 
> > just some random observations that might be of use,
> > in my job I occassionally have to deal with directories containing a very
> > large number of files and have a need to sieve them or operate in a
> > non-uniform manner on them.
> > 
> > so if you haven't yet encountered the 'argument list too big' error
> > message here's a few useful bits that might stave off the shakes
> > 
> > note: most of this can be accomplished with find, but these are the q+d
> > lines that will let you get the job done while you are reading the man
> > page for find
> > 
> > to get all files whose name matches a pattern and move them to another dir
> > 
> > ls|grep <pattern>|xargs -l1 mv --target-directory=/path/to/other/dir/
> > 
> > the important bits: xargs -l1 says to construct new commands from each
> > line of stdin it receives and the long option for mv is so that xargs can
> > use it as though the invocation of mv were something like
> > mv --target-directory=/some/random/path $1
> > 
> > So that's your Q+D shell trick for the day, remember there is a clinic
> > tonight. See you there
> > 
> > -- 
> > http://www.efn.org/~laprice        ( Community, Cooperation, Consensus
> > http://www.opn.org                 ( Openness to serendipity, make mistakes
> > http://www.efn.org/~laprice/poems  ( but learn from them.(carpe fructus ludi)
> > 
> > _______________________________________________
> > Eug-LUG mailing list
> > [EMAIL PROTECTED]
> > http://mailman.efn.org/cgi-bin/listinfo/eug-lug
> _______________________________________________
> Eug-LUG mailing list
> [EMAIL PROTECTED]
> http://mailman.efn.org/cgi-bin/listinfo/eug-lug
> 

-- 
http://www.efn.org/~laprice        ( Community, Cooperation, Consensus
http://www.opn.org                 ( Openness to serendipity, make mistakes
http://www.efn.org/~laprice/poems  ( but learn from them.(carpe fructus ludi)

_______________________________________________
Eug-LUG mailing list
[EMAIL PROTECTED]
http://mailman.efn.org/cgi-bin/listinfo/eug-lug

Reply via email to