myrm(){ D=/tmp/$(date +%Y%m%d%H%M%S); mkdir -p $D; mv "[email protected]" $D && echo "moved to $D ok"; }
[[email protected] test]# myrm(){ D=/tmp/$(date +%Y%m%d%H%M%S); mkdir -p $D; mv "[email protected]" $D && echo "moved to $D ok"; }
[[email protected] test]# alias rm=‘myrm‘
[[email protected] test]# touch 1.log 2.log 3.log
[[email protected] test]# ll
总计 16
-rw-r--r-- 1 root root 0 10-26 15:08 1.log
-rw-r--r-- 1 root root 0 10-26 15:08 2.log
-rw-r--r-- 1 root root 0 10-26 15:08 3.log
drwxr-xr-x 7 root root 4096 10-25 18:07 scf
drwxrwxrwx 2 root root 4096 10-25 17:46 test3
drwxr-xr-x 2 root root 4096 10-25 17:56 test4
drwxr-xr-x 3 root root 4096 10-25 17:56 test5
[root@localhost test]# rm [123].log
moved to /tmp/20121026150901 ok
[root@localhost test]# ll
总计 16drwxr-xr-x 7 root root 4096 10-25 18:07 scf
drwxrwxrwx 2 root root 4096 10-25 17:46 test3
drwxr-xr-x 2 root root 4096 10-25 17:56 test4
drwxr-xr-x 3 root root 4096 10-25 17:56 test5
[root@localhost test]# ls /tmp/20121026150901/
1.log 2.log 3.log
[root@localhost test]#