On 12/02/12 23:55, Joel Roth wrote:
Hi Shellsters,
I've got a directory structure like this:
./project1/bak/a.yml
./project1/bak/b.yml
./project2/bak/c.yml
./project2/bak/d.yml
I want to move the *.yml files into the corresponding parent directory.
I tried this:
for dir in `find -maxdepth
On Mon, Feb 13, 2012 at 09:50:08AM +, Chris Davies wrote:
> Joel Roth wrote:
> > ./project1/bak/a.yml
> > ./project1/bak/b.yml
> > ./project2/bak/c.yml
> > ./project2/bak/d.yml
>
> > I want to move the *.yml files into the corresponding parent directory.
>
> rename 's!(.*/)([^/]*)$!$1../$2!'
Joel Roth wrote:
> ./project1/bak/a.yml
> ./project1/bak/b.yml
> ./project2/bak/c.yml
> ./project2/bak/d.yml
> I want to move the *.yml files into the corresponding parent directory.
rename 's!(.*/)([^/]*)$!$1../$2!' project*/bak/*.yml
;-)
Chris
--
To UNSUBSCRIBE, email to debian-user-requ..
On Mon, Feb 13, 2012 at 10:12:14AM +0200, Andrei Popescu wrote:
> On Du, 12 feb 12, 20:01:05, Joel Roth wrote:
> > >
> > > for dir in `find -maxdepth 1 -type d`; do chdir $dir/bak; mv *.yml
> > > ../..; done
> >
> > Thanks, I got something like that to work.
>
> I would have tried something w
On Du, 12 feb 12, 20:01:05, Joel Roth wrote:
> >
> > for dir in `find -maxdepth 1 -type d`; do chdir $dir/bak; mv *.yml ../..;
> > done
>
> Thanks, I got something like that to work.
I would have tried something with find's '-execdir'
- no need to operate on find's output (not a good idea un
On Mon, Feb 13, 2012 at 01:44:21AM +, ACro wrote:
>
> > for dir in `find -maxdepth 1 -type d`; do chdir $dir/bak; mv *.yml .. ;
> > chdir
> > ../..; done
>
>
> Joel,
>
> try this, HTH:
>
> for dir in `find -maxdepth 1 -type d`; do chdir $dir/bak; mv *.yml ../..;
> done
Thanks, I got s
> for dir in `find -maxdepth 1 -type d`; do chdir $dir/bak; mv *.yml .. ; chdir
> ../..; done
Joel,
try this, HTH:
for dir in `find -maxdepth 1 -type d`; do chdir $dir/bak; mv *.yml ../..; done
Kind regards,
Andrew
--
To UNSUBSCRIBE, email to debian-user-requ...@lists.debian.org
with a
7 matches
Mail list logo