Under the current directory I have a number of files, and one directory. I would like to move all files to the sub directory:
mv ./* subdir/
cannot move ./subdir to a subdirectory of itself...
The warning is harmless but it makes mv return 1, therefore it's not possible to determine whether other files have been moved.
cp could help but I have some large files to move and it's not efficient enough.
Scripting would seem to work too, but I'd prefer a one liner if there is any.
shopt -s extglob
) and usemv ./!(subdir) subdir/