1.计算文件数和目录数下面的语句可以帮你计算有多少个文件和多少个目录# ls -l * |grep "^-"|wc -l ---- to count files# ls -l * |grep "^d"|wc -l ----- to count dir还可以将以上的语句变成script或做个alias...
分类:
系统相关 时间:
2014-10-15 10:32:00
阅读次数:
284
一、配置系统环境1.清除默认防火墙规则#serviceiptablessave
iptables:将防火墙规则保存到/etc/sysconfig/iptables:[确定]2.关闭Selinux#cat/etc/sysconfig/selinux|grepSELINUX|grep-v^#
SELINUX=disabled
SELINUXTYPE=targeted
#3.配置ip地址#cat
/etc/sysconfig/network-s..
分类:
其他好文 时间:
2014-10-14 21:32:29
阅读次数:
298
我也玩玩git,初入,本屌还是处在一头雾水,不知如何来玩git的阶段,下面先列一些常用的命令及git客户端安装安装rpm-qa|grepgit查看是否安装gityumlist|grep^git查看列表yuminstallgit-all.noarchgitversion把自己介绍给gitgitconfig--globaluser.name"xf"gitconfig--globaluse..
分类:
其他好文 时间:
2014-10-14 20:08:20
阅读次数:
221
# Grep 里面要无视某些目录 # 但 --exclude-dir=dir 需要 GNU Grep >= 2.5.2 grep -ri --exclude-dir=.git [someWords] *.java # 來玩一下 ACK 这东西 # 安裝和使用 brew install ack ac....
分类:
其他好文 时间:
2014-10-14 14:16:48
阅读次数:
308
一、grep1.用途:文本搜索工具,根据用户指定的文本模式(patten)对目标文件进行逐行搜索,显示能够被模式匹配的行内容。2.命令使用格式:grep[option]‘PATTEN’files…2.1常用选项详解2.1.1单文件查找:-n:显示匹配行的行号(为了显示清楚匹配行,下面的都用n+其他选项)-v..
分类:
其他好文 时间:
2014-10-14 03:35:18
阅读次数:
273
for branch_name in `git branch | grep b_`do git rm -f README.md git commit -m'rm README.md' git merge $branch_name git rm -f README.md ...
分类:
其他好文 时间:
2014-10-14 00:37:37
阅读次数:
239
python检测linux下运行的进程#-*-coding:utf8-*-
importsubprocess
importsys
status_ok=0
status_critical=2
defc(d_name):
cmd=‘ps-ef|grep%s|grep-v"grep"‘%d_name
p=subprocess.Popen(cmd,shell=True,stdout=subprocess.PIPE)
ifp.wait()==0:
val=p.stdout.read()
ifd_name..
分类:
编程语言 时间:
2014-10-13 21:12:07
阅读次数:
244
在安装一些包的时候,遇到g++:command not found error,这是由于系统缺失相对应的包 工具/原料CentOS64 方法/步骤在发现该错误时,先在系统中确认是否缺失相对应的包:rpm -qa | grep "g++"在确认系统未安装之后,查询可安装的相对应的功能的包:yum .....
分类:
其他好文 时间:
2014-10-13 19:55:47
阅读次数:
205
centOS的yum安装的MySQL是5.1版本,可通过官方的rpm包安装5.5版本# 查看安装的相关项rpm -qa|grep -i mysql# 停止服务service mysqld stop# 卸载yum remove mysql-*orrpm -e xxx# 下载MySQL5.5wget -...
分类:
数据库 时间:
2014-10-13 19:17:51
阅读次数:
193
进入终端 cd 路径
进入项目根目录
输入下面的命令,显示总行数(不包含空行,包括注释和应用第三方类)
find . -name "*.m" -or -name "*.h" -or -name "*.xib" -or -name "*.c" |xargs grep -v "^$"|wc -l
输入下面的命令,显示各个文件行数以及总行数(包含空行,包括注释和应用第三方类)
fin...
分类:
其他好文 时间:
2014-10-13 18:42:29
阅读次数:
224