RE: script help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



> 
> I run it but it has error. 
> 
> sed 's/^dir-192\.168/dir-10\.0/'`
> sed: read error on dir-192.168.0.31: Is a directory
> 


Was there an problem with Frank's response from earlier?

rename 192.168 10.0 dir*

It is a nice simple solution. You don't have to loop, or use extra
commands, just copy and paste that one command to your machine, and all
directories will be renamed. I just did it on 1000 directories, and it
took 0.052 seconds:

[mike@test-box test]$ ls -ld dir-192.168.0.* | wc -l
1000
[mike@test-box test]$ time rename 192.168 10.0 dir*


real    0m0.052s
user    0m0.012s
sys     0m0.040s
[mike@test-box test]$ ls -ld dir-10.0.0.* | wc -l
1000

Mike
_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos


[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux