我们知道在Linux中有许多许多的文件,有的时候凭借我们的记忆我们可能要找很久很久才能够找到我们所需要的文件,之前我们稍有提到过一个命令叫做find它确实是一个十分重要的命令。find的基本用法:和时间有关的参数:-atime、-ctime、-mtime、-newer**以-mtime为例,看看与事件..
分类:
系统相关 时间:
2016-05-15 19:58:36
阅读次数:
266
find[查找位置][查找标准][处理动作]查找路径:默认当前目录查找标准:默认为指定路径下的所有文件处理运作:默认为显示匹配标准:-name‘FILENAME‘:对文件名文件名通配:*:任意长度的任意字符?[]-iname‘FILENAME‘:文件名匹配时不区分大小写-regexPATTERN:基于正则表达式进行..
分类:
系统相关 时间:
2016-05-15 19:55:11
阅读次数:
226
Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes ...
分类:
其他好文 时间:
2016-05-15 18:10:47
阅读次数:
132
几个使用频繁的命令tar/diff/patch/grep/find使用例子 ...
分类:
其他好文 时间:
2016-05-15 13:54:17
阅读次数:
131
Given the relations of all the activities of a project, you are supposed to find the earliest completion time of the project. Input Specification: Eac ...
分类:
其他好文 时间:
2016-05-15 12:15:40
阅读次数:
195
问题描述: 在sublime text里写最简单的python语句hello world: print ('hello world') Ctrl+B build后出错如下图: 解决办法: 这个问题的原因说起来很幼稚,就是因为没有保存文件。所以只需要保存一下文件,再回来build即可。 ...
分类:
编程语言 时间:
2016-05-15 11:06:23
阅读次数:
3292
打印某个路径下的所有文件,我们可以通过find命令实现(find路径-typef)。下面我通过Python的递归来实现这个功能。[root@centos~]#vimprint_files.py#!/usr/bin/pythonimportosimportsysdefprint_files(path):lsdir=os.listdir(path)dirs=[iforiinlsdirifos.path.isdir(os.pat..
分类:
编程语言 时间:
2016-05-15 00:44:19
阅读次数:
337
#!/bin/bash#/usr/local/xxx/bin/xxxx.sh start#/usr/local/xxx/bin/startup.shfor i in `find /server -name start.sh` do fadir=`dirname $i` //读取父目录 cd $fad ...
分类:
系统相关 时间:
2016-05-15 00:31:32
阅读次数:
250
Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the or ...
分类:
其他好文 时间:
2016-05-14 23:03:01
阅读次数:
171
http://www.lintcode.com/zh-cn/problem/search-in-a-big-sorted-array/ 给一个按照升序排序的正整数数组。这个数组很大以至于你只能通过固定的接口 ArrayReader.get(k) 来访问第k个数。(或者C++里是ArrayReade ...
分类:
其他好文 时间:
2016-05-14 22:47:32
阅读次数:
303