linux批量重命名目录下某类型的文件—括子目录中的~
[root@ftp test]# ls -R
.:
aircraft.txt connect_leg.txt flight_day.txt restrict_class.txt
airline.txt date_day.txt flight_fare.txt restriction.txt
airport_service.txt day_name.txt flight.txt state.txt
airport.txt dual_carrier.txt food_service.txt stop1.txt
city.txt fare.txt ground_service.txt stop.txt
class_of_service.txt fconnection.txt jdjdj time_interval.txt
code_description.txt file.txt month_name.txt time_zone.txt
compound_class.txt flight_class.txt restrict_carrier.txt transport.txt
./jdjdj:
aircraft.txt connect_leg.txt flight_fare.txt state.txt
airline.txt date_day.txt flight.txt stop1.txt
airport_service.txt day_name.txt food_service.txt stop.txt
airport.txt dual_carrier.txt ground_service.txt time_interval.txt
city.txt fare.txt month_name.txt time_zone.txt
class_of_service.txt fconnection.txt restrict_carrier.txt transport.txt
code_description.txt flight_class.txt restrict_class.txt
compound_class.txt flight_day.txt restriction.txt
把./ and ./jdjdj
下的.txt重命名为.ini
其实就困难在子目录上,当前目录还是能做出来的
#ls -lR|grep .txt|awk '{print $0$9}' >; file.txt
#awk -F. '{print "mv "$1"."$2" "$1".ini"}' file.txt
阅读(980) | 评论(0) | 转发(0) |