zoukankan      html  css  js  c++  java
  • shell 文件操作

     
      
      在linux平台下开发,我们经常会接触到一些任务性质的工作,而处理方式多样化。现积累各个案例。
     
    从远程服务器拉取文件到本地服务器
      
    scp work@cp01-xx-dev.com:/home/xx/data/relation/filename ./
     
    清理近7天的数据
      
      日志文件越来越大,我们需要及时的去做清理工作。配合工具:find,xargs
     
    #!/bin/bash
    for p in `find ./ -type d -name log`; do
      find "$p" -mtime +7  | xargs -i rm -f {} &
    done
    

      

  • 相关阅读:
    CF1042E Vasya and Magic Matrix
    Luogu 4868 Preprefix sum
    CF1042F Leaf Sets
    CF1041F Ray in the tube
    【Luogu】P1410子序列(DP)
    【Luogu】P1383高级打字机
    【Luogu】P1681最大正方形2(异或运算,DP)
    【Luogu】P1122最大子树和(DFS,树上DP)
    【Luogu】P2258子矩阵(状态压缩,DP)
    【Luogu】P2158仪仗队(欧拉函数)
  • 原文地址:https://www.cnblogs.com/baochuan/p/4666483.html
Copyright © 2011-2022 走看看