The gnu version of
On systems that don’t have gnu’s
ls, your best bet is two successive calls to
-mindepth n and
-type t with the appropriate options.
find . -maxdepth 1 -mindepth 1 -type d find . -maxdepth 1 -mindepth 1 \! -type d
For copying files, with the target first, you would have to write a script that saves the first argument, then uses
shift, and appends the argument to the end.
#!/bin/sh target="$1" shift cp -r -- "$@" "$target"