Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4975440
  • 博文数量: 1696
  • 博客积分: 10870
  • 博客等级: 上将
  • 技术积分: 18357
  • 用 户 组: 普通用户
  • 注册时间: 2007-03-30 15:16
文章分类
文章存档

2017年(1)

2016年(1)

2015年(1)

2013年(1)

2012年(43)

2011年(17)

2010年(828)

2009年(568)

2008年(185)

2007年(51)

分类: LINUX

2008-03-04 12:03:53

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
阅读(932) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~