Re: Make action on all files in a dir recursively
There is another way: "find -exec" but in common case the "xargs" is better. I would recommend you to read "info find, "Action: Adding Tests"" for understanding difference between these two ways. On Sat, Sep 01, 2001 at 11:45:47AM +0200, joost witteveen wrote: > > find $dir -type f | xargs echo > > or > > find $dir -type f | xargs -n 1 echo > > (try to see the difference). > -- > joostje > -- [EMAIL PROTECTED]
Re: Make action on all files in a dir recursively
Je 2001/09/01(6)/13:09, Konstantin V. Sorokin montris sian geniecon skribante: > On Sat, Sep 01, 2001 at 12:52:45PM +0400, Ingvarr Zhmakin wrote: > > Доброе утро. > > > > Как бы попроще в bash сделать команду на все файлы в директории > > _рекурсивно_? > > > >Ingvarr. > > cd dir/ > for f in $(find); do echo $f; done I don't understand russian, but it seems to me he wanted to do something on files, not the directories: for f in $(find $dir -type f); do echo $f; done Or, if you want it to work too when there are *many* files (above the bash comand line limit), then you probably have to use: find $dir -type f | xargs echo or find $dir -type f | xargs -n 1 echo (try to see the difference). -- joostje
Re: Make action on all files in a dir recursively
On Sat, Sep 01, 2001 at 12:52:45PM +0400, Ingvarr Zhmakin wrote: > Доброе утро. > > Как бы попроще в bash сделать команду на все файлы в директории _рекурсивно_? > >Ingvarr. cd dir/ for f in $(find); do echo $f; done -- WBR, Konstantin V. Sorokin :wq