码迷,mamicode.com
首页 >  
搜索关键字:awk sort    ( 17174个结果)
sshkey 批量免密登录
脚本:#!/bin/bashline=`awk‘END{printNR}‘password.txt`foriin`seq1$line`doip=`head-n$ipassword.txt|tail-1|awk‘{print$1}‘`port=`head-n$ipassword.txt|tail-1|awk‘{print$2}‘`password=`head-n$ipassword.txt|tail
分类:其他好文   时间:2020-05-25 15:30:17    阅读次数:49
「土」巨石滚滚
https://ac.nowcoder.com/acm/problem/53681 intial : a 从小到大,b 从大到小 finally b - a分为连部分 前部分 : 正的 a 从小到大, 后部分 : 负的 b 从大到小 ??? 最后收益是正的,也就是说m是一直增加的,自然要从消耗小的开 ...
分类:其他好文   时间:2020-05-25 12:26:57    阅读次数:49
inotify 监控几个脚本
inotify 监控简单shell for foo in /proc/*/fd/*; do readlink -f $foo; done | grep inotify | sort | uniq -c | sort -nr 一个很不错的script #!/bin/sh ? # Get the pro ...
分类:其他好文   时间:2020-05-25 12:10:58    阅读次数:73
lc 排序链表
链接:https://leetcode-cn.com/problems/sort-list/ 代码: /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNod ...
分类:编程语言   时间:2020-05-24 23:59:47    阅读次数:102
jdk8 Collections#sort究竟做了什么
前言 Collections#sort 追踪代码进去看,会调用到Arrays.sort,看到这里时,你肯定会想,这不是很简单,Arrays.sort在元素较少时使用插入排序,较多时使用快速排序,更多时使用归并排序,不过我要告诉你,这句话有一个前提,那就是针对基本类型排序时,是按照这个顺序,而 Col ...
分类:其他好文   时间:2020-05-24 22:33:53    阅读次数:81
使用Shell脚本监控Linux主机
编写如下脚本(根据实际情况来修改邮件发送目的地址):[root@centos02~]#catsystem.sh#!/bin/bashdug=$(df-h|grep"/$"|awk‘{print$5}‘|awk-F%‘{print$1}‘)cug=$(expr100-$(mpstat|tail-1|awk‘{print$12}‘|awk-F.‘{print$1}‘))mug=$(expr$(free
分类:系统相关   时间:2020-05-24 20:54:21    阅读次数:69
归并排序模板
参考博客:https://www.cnblogs.com/chengxiao/p/6194356.html sort不稳定。归并排序是较为稳定的一种排序算法 复杂度:nlogn 本排序的一个应用:HDU 4911 求逆序对数量:http://acm.hdu.edu.cn/showproblem.ph ...
分类:编程语言   时间:2020-05-24 19:19:03    阅读次数:56
排序算法
冒泡排序(Bubble Sort) 实现 每一轮,从数组头部开始,每两个元素比较大小并进行交换,直到这一轮当中最大或最小的元素被放置在数组的尾部,然后不断地重复这个过程,直到所有元素都排好位置。其中,核心操作就是元素相互比较。 例题 给定数组 [2, 1, 7, 9, 5, 8],要求按照从左到右、 ...
分类:编程语言   时间:2020-05-24 11:49:17    阅读次数:56
【LeetCode】4. 寻找两个正序数组的中位数
题目描述 给定两个大小为 m 和 n 的正序(从小到大)数组?nums1 和?nums2。 请你找出这两个正序数组的中位数,并且要求 算法的时间复杂度为?O(log(m + n))。 你可以假设?nums1?和?nums2?不会同时为空。 示例 1: 示例 2: 题解代码 提交 更多题解 "详细通俗 ...
分类:编程语言   时间:2020-05-24 11:47:22    阅读次数:119
What is the difference between sed and awk
What is the difference between sed and awk sed is a stream editor. It works with streams of characters on a per-line basis. It has a primitive program ...
分类:其他好文   时间:2020-05-24 11:34:00    阅读次数:81
共17174条   上一页 1 ... 76 77 78 79 80 ... 1718 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!