Use curingas.
cp /home/user1/*/*z newfolder/
Alguns curingas incluem *
, ?
e []
.
*
matches any number of characters which can be any character
?
matches one character which can be any character
[]
matches one character which is within the range of characters defined
Exemplo:
[jin@crypt /tmp] % ls foo/*/*
foo/bar/1a foo/bar/1c foo/baz/1a foo/baz/1c foo/baz/2d foo/quux/1b foo/quux/1d
foo/bar/1b foo/bar/1d foo/baz/1b foo/baz/1d foo/quux/1a foo/quux/1c foo/quux/3d
[jin@crypt /tmp] % ls foo/*/*d
foo/bar/1d foo/baz/1d foo/baz/2d foo/quux/1d foo/quux/3d
[jin@crypt /tmp] % ls foo/ba?/*d
foo/bar/1d foo/baz/1d foo/baz/2d
[jin@crypt /tmp] % ls foo/ba??/*d
zsh: no matches found: foo/ba??/*d
[jin@crypt /tmp] % ls foo/baz/*[a-c]
foo/baz/1a foo/baz/1b foo/baz/1c