zoukankan      html  css  js  c++  java
  • for memory long term update

    xargs是一条Unix和类Unix操作系统的常用命令。它的作用是将参数列表转换成小块分段传递给其他命令,以避免参数列表过长的问题.

    #例如,下面的命令:
        
    rm `find /path -type f`
    #如果path目录下文件过多就会因为“参数列表过长”而报错无法执行。但改用xargs以后,问题即获解决。
    
    find /path -type f -print0 | xargs -0 rm
    #本例中xargs将find产生的长串文件列表拆散成多个子串,然后对每个子串调用rm。这样要比如下使用find命令效率高的多。
    
    find /path -type f -exec rm '{}' ;
    #上面这条命令会对每个文件调用"rm"命令。当然使用新版的"find"也可以得到和"xargs"命令同样的效果:
    #花括号 {} 代表使用 find 命令找到的文件。
    find /path -type f -exec rm '{}' +
    #xargs的作用一般等同于大多数Unix shell中的反引号,但更加灵活易用,并可以正确处理输入中有空格等特殊字符的情况。对于经常产生大量输出的命令如find、locate和grep来说非常有用
    ssh user@ip -p port#ssh login
    scp -P port  brand@targetIp:/data/apache-flume-1.5.0/bin/flume-ng /home/brand/#transport flume-ng

      #scp远程拷贝
      #-r 传文件夹
      #先目标路径 后保存路径

    #curl是利用URL语法在命令行方式下工作的开源文件传输工具。
    
     wget --no-cookies --no-check-certificate --header "Cookie:gpw_e24=http%3a%2f%2fwww.oracle.com%2ftechnetwork%2fjava%2fjavase%2fdownloads%2fjdk7-downloads-1880260.html;oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/7u75-b13/jdk-7u75-linux-x64.rpm
    
    #后台执行,输出到nohup.out
    nohup sudo bin/flume-ng agent --conf conf -f conf/flume.conf -n agent &
    
    nohup sudo bin/elasticsearch &
    #mysql.sock文件是服务器与本地客户端进行通信的Unix套接字文件
    #[===xxx@szmlserver137_5 ~]$ netstat -aux|grep mysql
    #unix  2      [ ACC ]     STREAM     LISTENING     139237 /data/mysqldata/mysql-basketball/mysql-basketball.sock
    #unix  2      [ ACC ]     STREAM     LISTENING     139281 /data/mysqldata/mysql/mysql.sock
    sudo  mysql -uxxx=== -p -S /data/mysqldata/mysql-basketball/mysql-basketball.sock
    #临时修改每个进程可打开的文件数
    #非内置命令,sudo下 利用exec调用
     sudo sh -c "ulimit -n 4096 && exec su $brand"
    #
    #搜索匹配的路径,并且输出文件大小和详细路径
    # $5,$9 结果空格隔开, $5 $9 结果粘在一起
    #
    #264 /data/upload/resource/material/YI4U2S/581/gcode/object-874-Happy-Birthday-with-Candles-happy-birthday-2OjxE.gcode
    #426 /data/upload/resource/material/YZUHWC/239/gcode/egg_bottom.gcode
    #426 /data/upload/resource/material/YZUHWC/239/gcode/egg_top.gcode
    #
    ls /data/upload/resource/material/*/*/gcode/*.gcode -al | awk '{ if($5<1024) { print $5,$9 } else {} }'

      

    给笨笨的自己提个醒>_<~
  • 相关阅读:
    Remove Duplicates from Sorted List II [LeetCode]
    Valid Palindrome [LeetCode]
    Merge Sorted Array [LeetCode]
    Binary Tree Postorder Traversal
    Subsets [LeetCode]
    Search for a Range [LeetCode]
    Reorder List [LeetCode]
    GCC 默认用哪个标准
    18 组装类举例
    17 实例方法、静态方法、类方法
  • 原文地址:https://www.cnblogs.com/ephuizi/p/4341483.html
Copyright © 2011-2022 走看看