【版权声明:转载请保留出处:blog.csdn.net/gentleliu。Mail:shallnew at 163 dot com】
Linux系统中有很多文件,比如配置文件、日志文件、用户文件等。文件中都包含了大量的信息,我们可以使用cat等命令轻松将其输出到屏幕,但如果要从文件中分析或提取数据,还需要其他工具来实现。而linux正好提供了这些工具:grep、awk、sed等。把这些工具使用...
分类:
其他好文 时间:
2014-08-24 22:20:03
阅读次数:
278
awk简介awk是一种编程语言,由AT&T贝尔实验室的AlfredAho,PeterWeinberger和BrianKernighan开发一种对文件进行指定规则浏览和抽取信息的工具。当然,有awk必然还要说sed,这俩都是上古神器,功能十分强大,sed和awk各有各的有点,awk在速度上要慢于sed。awk基本语法awk[op..
分类:
其他好文 时间:
2014-08-24 19:29:33
阅读次数:
349
Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After ...
分类:
其他好文 时间:
2014-08-24 19:13:32
阅读次数:
194
cat tail -f日 志 文 件 说 明/var/log/message 系统启动后的信息和错误日志,是Red Hat Linux中最常用的日志之一/var/log/secure 与安全相关的日志信息/var/log/maillog 与邮件相关的日志信息/var/log/cron 与定时任务相关...
分类:
系统相关 时间:
2014-08-24 16:34:42
阅读次数:
286
思路:递归执行,子函数需要返回子链表的head和tail,所以借助内部类NodePair来实现。/** * 4 / \ 2 5 / \ \ 1 3 6 / 0 0123456 * */public ...
分类:
其他好文 时间:
2014-08-24 12:51:12
阅读次数:
267
一、内核定时器定义:struct timer_list { struct list_head entry; unsigned long expires; void (*function)(unsigned long); unsigned long data; struc...
分类:
系统相关 时间:
2014-08-24 11:30:02
阅读次数:
241
+++++++++++++++++++++++++ +++++Shell编程+++++++++++++++++++++++++++++++1. 基础正则表达式 正则表达式与通配符: 正则表达式用来在文件中匹配符合条件的字符串,正则是包含匹配,grep awk sed等命令可以支持正则表达式...
分类:
系统相关 时间:
2014-08-24 09:07:12
阅读次数:
282
Recursion. ?????/**
?????*?sum?from?1?to?n.?recursion
?????*?@param?i
?????*?@return?sum?
?????*/
????public?int?recur_head(int?i){
????????Syste...
分类:
编程语言 时间:
2014-08-23 20:26:41
阅读次数:
178
解题报告
思路:
spfa判负环。
#include
#include
#include
#include
#define inf 0x3f3f3f3f
#define N 40000
#define M 100000
using namespace std;
struct node {
int v,w,next;
} edge[M];
int head[N],dis[N],...
分类:
其他好文 时间:
2014-08-23 20:25:41
阅读次数:
261
解题报告
题目传送门
思路:
bfs建图跑一下费用流就行。
#include
#include
#include
#include
#define inf 0x3f3f3f3f
using namespace std;
struct E {
int v,cost,cap,next;
} edge[100000];
int head[1000],cnt,dis[1000],...
分类:
其他好文 时间:
2014-08-23 19:07:51
阅读次数:
243