Help with copy files from multiple directories one inside other of the same type to one directory

Pupeno pupeno at pupeno.com
Sat Jul 29 18:23:45 UTC 2006


What about
file . -name "*.deb" -exec mv {} /destination/path/ ";"
?
On Saturday 29 July 2006 17:59, Alexander Skwar wrote:
> · Todd Slater <dontodd at gmail.com>:
> > On 7/29/06, Alexander Skwar <listen at alexander.skwar.name> wrote:
> >> · Todd Slater <dontodd at gmail.com>:
> >> > for deb in `find /top/level/directory -type f -iname '*.deb'`
> >>
> >> *EXTREMELY* bad. What do you do, when there are file- and/or directory
> >> names with spaces?
> >
> > I understand that, but I've never met a .deb with a space in the name,
>
> Me neither, but you don't know, how the directories are named. Well -
> I don't know, at least.
>
> > which is why I gave this example. I figured it might be easier for
> > somebody obviously new to CLI.
>
> Well, in this case, hints should be given, which will work in
> many more cases. "for f in `find`" doesn't work, if the file
> or directory names contain spaces and also special characters (eg.
> line break, tab, ...).
>
> Hence I gave the hint to do
>
>         find | while ...
>
> Alexander Skwar
> --
> Ich habe das Problem, daß ich zuviel weiß.
>                 -- Prof. Informationssysteme, FH Schweinfurt

-- 
Pupeno <pupeno at pupeno.com> (http://pupeno.com)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20060729/bc62e7ad/attachment.sig>


More information about the ubuntu-users mailing list