linux move all directories under the current directory to another directory

linux move all directories under the current directory to another directory

 

# / mnt / disk1 last directory is moved to 
ls -d ./*/ | xargs -I {} mv {} / mnt / disk1 /

  ./*/ represents the view the current directory for all directory. If another directory hanging himself for other directories. eg: / mnt / disk2 / * /

Guess you like

Origin www.cnblogs.com/singsong-ss/p/12032118.html