简体   繁体   中英

How to move all files within subfolders into a new folder using bash?

I have a folder that I downloaded all my fonts to. When I opened the folder i noticed they were saved out into subfolders.

Is there a bash-shell script to grab all the files within the subfolders and move them to the parent folder?

You can move files with same extensions recursively using the wildcards. eg if you want to move all log files in nested folders under log/ directory into backup/ directory, you can use the following command:

mv log/**/*.log backup/

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