[英]How to copy files with a particular extension from one directory to another in linux
[英]How to copy files with one extension to another extension
我的 linux 機器上的當前目錄中有 bs cs ds 文件,我想將它們復制到新的擴展名 .S 中,如 aS bS cS dS
請幫我做這件事。
for each in `ls *.s`; do filename="${each%.*}"; extension="${each##*.}" ; do mv ${each} ${filename}".S" ; done;
這個腳本也可以做到。
對於 *.s 中的文件 do cp -i "${file}" "${file/.s/.S}" done
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.