Aar*_*ron 0 directory bash move
我在同一个父目录中有大约100个目录符合命名约定[sitename] .com.我想将它们全部重命名为[sitename] .subdomain.com.
这是我试过的:
for FILE in `ls | sed 's/.com//' | xargs`;mv $FILE.com $FILE.subdomain.com;
Run Code Online (Sandbox Code Playgroud)
但它失败了.有任何想法吗?
使用重命名(1).
rename .com .subdomain.com *.com
Run Code Online (Sandbox Code Playgroud)
rename s/\\.com$/.subdomain.com/ *.com
Run Code Online (Sandbox Code Playgroud)