简体   繁体   中英

linux move files inside sub folder to current directory

hi i need a command for linux and mac os to move files from all subfolders to the current one.

I have the main folder (04) containing other folders ex. 01145032 that contains jpgs and other files. i have to move this files in 04 folder Thanks

You can use this find command:

cd 04
find . -type f -mindepth 2 -exec mv '{}' . \;

-mindepth 2 will make sure that only files from sub directories are found.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM