摘要: 在很多服务日志的情况下,或者有很多零散的文件要批量整理到一起时,通过shell脚本能很快解决:DATE=$(date +%Y_%m_%d-%H%M%S); find * -type f | while read file; do mv $file ${file}.${DATE}; done以上语句能快速找出目录下所有文件,并重命名。那么如果要找出指定后缀的文件,并重命名该如何操作呢?为了更好的理解,下面来把代码分开执行:find ./log -name "*.log" | while read filedoDATE=$(date +%Y%m%d_%H%M%S_%N)mv $ 阅读全文
posted @ 2012-08-03 22:21 透传云 阅读(908) 评论(0) 推荐(0) 编辑
摘要: 先在 from 那台機器中下:ssh-keygen -t rsa他會問你三個問題Enter file in which to save the key (/home/from/.ssh/id_rsa):就按Enter吧!Enter passphrase (empty for no passphrase):就直接按EnterEnter same passphrase again:一樣按Enter他會跟你說你的檔案放在哪裡,通常是放在 ~/.ssh/id_rsa.pub把id_rsa.pub的內容複製起來進 to@10.1.198.222然後把文字插入到 to@10.1.198.222的 ~/.s 阅读全文
posted @ 2012-08-03 22:18 透传云 阅读(906) 评论(0) 推荐(0) 编辑