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

Reply via email to