跳过正文
  1. Posts/

linux下大小写批量转换

·49 字·1 分钟·
Kubehan
作者
Kubehan
云原生知识栈:深度解析容器技术、Kubernetes、Istio、DevOps 实践、Prometheus 监控、Envoy 代理、Golang 开发及云原生架构与微服务趋势的专业博客

大写转小写:

for fname in *; do mv $fname `echo $fname|tr [A-Z] [a-z]`; done

小写转大写:

  for cpplive in *; do mv $cpplive `echo $cpplive|tr [a-z] [A-Z]`; done

大写转小写:

  for cpplive in *; do mv $cpplive `echo $cpplive|tr [A-Z] [a-z]`; done

修改后缀:

  for cpplive in *.JPG; do mv $cpplive ${cpplive%%\.*}.jpg; done