I want to move all files in /a to its subdirectory /a/b.
This sounds easy, but to make it work for all conditions:
/a does not contain any files, /a contains too many files, ...
and error free may not be easy.
The best solution that I can come up with is:
touch /a/dummy
find /a/* -prune -type f -print -exec mv {} /a/b \;
rm /a/b/dummy
But this is not elegant. Better solutions wanted. Thank you.
--
unix programs: niftp (non-interactive recursive ftp), hide (hide command args),
submit (replace nohup), etc from ftp://ftp.mindspring.com/users/mwang/unix-prog