How can I use a wildcard to match just files, not directories?

With zsh, use glob qualifiers:

mv home*(.) dst 

moves only regular files.

While

mv home*(^/) dst 

moves files of any type except directories.

mv home*(^-/) dst

would also exclude symlinks to directories.


You can use find. The following should work.

find . -name home\* -type f -maxdepth 1 -exec mv {} /home/homeLife/. \;

You can use bash extended globs:

shopt -s extglob                ## activate extglogs if not yet done
mv  home!(*Life) homeLife/      ## !(p1|...) = anything except one of the patt