Bash move * to subfolder fail: cannot move to a subdirectory of itself -


i have folder several files want move subfolder:

mkdir subfolder mv ./* subfolder 

but when this, get:

mv: cannot move 'subfolder' subdirectory of itself

how can avoid this?

using extglob can this:

shopt -s extglob  mv !(subfolder) subfolder 

glob expression !(subfolder) match except subfolder.


Comments

Popular posts from this blog

inversion of control - Autofac named registration constructor injection -

verilog - Systemverilog dynamic casting issues -

ios - Change Storyboard View using Seague -