- 论坛徽章:
- 0
|
[root@amanda1 ~]# ls -l --time-style +%Y%m%d -tr
total 232
-rw-r--r-- 1 root root 26690 19981020 config.guess
-rwxr-xr-x 1 root root 6579 19990223 rempath.sh
-rwxr-xr-x 1 root root 3891 19990223 localpath.sh
-rw-r--r-- 1 root root 10985 19990223 hostdump.html
-rwxr-xr-x 1 root root 46299 19990223 hostdump.sh
-rw-r--r-- 1 root root 36531 20101009 install.log.syslog
-rw-r--r-- 1 root root 60034 20101009 install.log
-rw-r--r-- 1 root root 1246 20101009 anaconda-ks.cfg
drwxr-xr-x 2 root root 4096 20101009 Desktop
-rw-r--r-- 1 root root 607 20101010 id_dsa.pub
-rwxr-xr-x 1 root root 5221 20101102 rsync.sh
[root@amanda1 ~]# ls -l --time-style +%Y%m%d -tr| grep -v "total" | awk '{print $6 ,$7}'
19981020 config.guess
19990223 rempath.sh
19990223 localpath.sh
19990223 hostdump.html
19990223 hostdump.sh
20101009 install.log.syslog
20101009 install.log
20101009 anaconda-ks.cfg
20101009 Desktop
20101010 id_dsa.pub
20101102 rsync.sh
以上按时间顺序列出了文件名和文件时间 , 怎么将每个文件按时间来重命名
比如: 20101102 rsync.sh 重命名为: 20101102_rsync.sh |
|