Linux下shel脚本之批量修改文件扩展名
一、脚本要求
二、脚本内容
三、运行脚本
- 一、脚本要求
- 二、脚本内容
- 三、运行脚本
一、脚本要求 1.在/data/tmp/下的所有文件扩展名改为.py
二、脚本内容 1.查看要修改扩展名的目录
[root@control tmp]# ll
total 0
-rw-r--r--. 1 root root 0 Apr 30 14:06 file0.txt
-rw-r--r--. 1 root root 0 Apr 30 14:06 file10.txt
-rw-r--r--. 1 root root 0 Apr 30 14:06 file11.txt
-rw-r--r--. 1 root root 0 Apr 30 14:06 file12.txt
-rw-r--r--. 1 root root 0 Apr 30 14:06 file13.txt
-rw-r--r--. 1 root root 0 Apr 30 14:06 file14.txt
-rw-r--r--. 1 root root 0 Apr 30 14:06 file15.txt
-rw-r--r--. 1 root root 0 Apr 30 14:06 file16.txt
-rw-r--r--. 1 root root 0 Apr 30 14:06 file17.txt
-rw-r--r--. 1 root root 0 Apr 30 14:06 file18.txt
-rw-r--r--. 1 root root 0 Apr 30 14:06 file19.txt
-rw-r--r--. 1 root root 0 Apr 30 14:06 f