杂记
来源:互联网 发布:瑞典大学排名 知乎 编辑:程序博客网 时间:2024/04/29 21:04
1、利用awk判断不重复的元素列
awk -F'|' '{if(!x[$3]++) print $3}' 20141128_sgl.txt
2、删除指定程序的进程
ps -ef |grep WebService|grep -v grep |awk '{print $2}' | xargs kill -9
3、mount挂载NSF
mount -t cifs //192.168.1.8/DataProject /mnt/data -o username=guest,password=mycapital
4、删除指定目录下的带后缀的所有文件
find . -name '*.pyc' | xargs rm
5、查找指定文件夹下所有文件的某内容
find . -type f |xargs grep 'needworld'
6、mysql创建utf8编码的数据库
create database if not exists rss_debug default character set utf8 collate utf8_general_ci;
7、awk统计特定数据个数
awk -F'|' 'BEGIN{cnt=0} {if($5 > 0){cnt+=1}} END{print cnt}' 20141128_dep.txt
8、awk查找进程的pid
ipcs | awk '{if($2~/^[0-9]+$/) print $2}'
9、linux命令下转化时间戳
date -d "@1332700478"
date -d "2012-03-26 02:34:38" +%s
10、mysql授权外网访问
grant all privileges on *.* to 'root'@'%' identified by 'password' with grant option;
flush privileges;
flush privileges;
修改/etc/mysql/my.conf
找到bind-address = 127.0.0.1这一行
改为bind-address = 0.0.0.0即可
找到bind-address = 127.0.0.1这一行
改为bind-address = 0.0.0.0即可
0 0
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- 杂记
- linux挂载文件系统
- QT——与 Javascript 交互
- GregoranCalandar类(java核心P103)
- Cordova配置自己的Plugin
- 我的Android日记(一),获取Android版本号
- 杂记
- oracle job 定时执行 存储过程
- SetupDiEnumDeviceInterfaces返回false WIN7/WIN8
- Handler的使用
- 关于TCP/IP数据包结构一文的进一步说明(常见协议数据报结构及TCP三次握手机制)
- 移动端性能大比拼:CSS Sprites vs. Data URI
- Datamine软件及功能介绍(转)
- 2011考研复试分数线发布时间:预计…
- ogre里面的点到面的距离