
linux
passer199101
这个作者很懒,什么都没留下…
展开
-
脚本输出01到15的数值之seq的用法
http://fantefei.blog.51cto.com/2229719/1172813seq -w 1 10转载 2017-10-20 14:35:59 · 1049 阅读 · 0 评论 -
使用nc传输数据
参考http://blog.youkuaiyun.com/slvher/article/details/9668749 http://blog.youkuaiyun.com/caoshuming_500/article/details/23755713发送端nc 3.1.5.7 9999 < demo.txt接收端(3.1.5.7)nc -l 9999 >demo.txt原创 2016-10-28 13:17:04 · 3067 阅读 · 0 评论 -
linux 时间同步的方法
http://blog.51yip.com/server/1474.html由于硬件的原因,机器或多或少的根标准时间对不上,一个月的误差几秒到几分钟不等。对于服务器来说时间不准,会有很多麻烦。例如,支付的时候,无法下单,游戏无法登录等。自己用的PC就无所谓了,手动改一下就行了。 一,用ntpdate从时间服务器更新时间 如果你的linux系统根本没有ntpdate这个命令yum install原创 2016-11-04 17:20:57 · 387 阅读 · 0 评论 -
linux如何关闭防火墙
https://zhidao.baidu.com/question/303901938543294164.html 1) 重启后生效 开启: chkconfig iptables on 关闭: chkconfig iptables off 2) 即时生效,重启后失效 开启: service iptables start 关闭: service iptables stop 需要说明的转载 2016-11-04 17:06:32 · 3378 阅读 · 1 评论 -
linux supervise的使用
参考:http://blog.youkuaiyun.com/yangshiqi1089/article/details/6002272 http://jamesreubenknowles.com/centos5-daemontools-143下载http://cr.yp.to/daemontools/daemontools-0.76.tar.gz安装在根目录建立文件夹 /package, mkdir -p /原创 2016-07-06 15:44:09 · 3774 阅读 · 0 评论 -
linux命令行中显示redis的中文编码
echo -e -n '"{\"k_w\":\"\xe6\x9d\xa8\xe5\xb9\x82, \xe5\x8d\x8a\xe8\xbe\xb9\"}"'原创 2016-05-03 23:32:13 · 1711 阅读 · 0 评论 -
将启动命令中包含某个字符串的进行杀死
[root@dn01 testbash]# ps -ef | grep helloroot 24794 7457 0 11:09 pts/2 00:00:00 sh hello.shroot 24910 7457 0 11:09 pts/2 00:00:00 sh hello.shroot 25295 7457 0 11:11 pts/2原创 2016-05-03 23:31:33 · 262 阅读 · 0 评论 -
shell遍历目录下所有文件
1filelist=`ls /home/work/file/`for file in $filelistdo echo $filedone一定要切记filelist=后边的那个引号不是单引号,而是tab键上边的那个键,或者说是1左边的那个键。否则的话不起作用。 转自http://blog.163.com/clevertanglei900@126/blog/static/11135225原创 2016-05-03 23:29:23 · 43795 阅读 · 0 评论 -
CentOS修改主机名
修改如下三个文件中的主机名 [root@iZ25ps5j2tjZ ~]# vi /etc/sysconfig/network [root@iZ25ps5j2tjZ ~]# vim /etc/hostname [root@iZ25ps5j2tjZ ~]# vim /etc/hosts原创 2016-05-10 18:55:56 · 304 阅读 · 0 评论 -
Use xargs to pass command to kill a process
ps -ax | grep command | awk '{print $1}' | xargs -i kill -9 {}转载 2015-12-01 11:51:44 · 513 阅读 · 0 评论 -
linux df du 查看文件和文件夹大小
http://www.cnblogs.com/benio/archive/2010/10/13/1849946.html转载 2015-11-26 10:40:18 · 481 阅读 · 0 评论 -
linux 执行远程命令
#!/bin/bashbase=/home/mcps aux | grep message | grep -v grep | awk '{print $2}' | xargs kill -9echo "mc stop!"#停止slavescat $base/config/slaves | while read linedossh root@$line > /dev/null原创 2015-11-19 15:17:05 · 533 阅读 · 0 评论 -
怎么查看redhat liunx 是32位还是64位
Red Hat Enterprise Linux上有一条命令:# arch结果是i686则是32位,x86_64则是64位。转载 2015-11-24 15:11:17 · 5224 阅读 · 0 评论 -
如何使用XShell登录亚马逊EC2云服务器
http://jingyan.baidu.com/article/a3a3f811d5fc338da2eb8a00.html原创 2015-11-24 13:30:52 · 6965 阅读 · 0 评论 -
定时检测Memcached进程是否存在,若不存在自动启动它
http://outofmemory.cn/code-snippet/1350/dingshi-detect-Memcached-process-shifou-exist-ruo-bu-exist-zidong-start-ta转载 2015-11-16 16:44:19 · 670 阅读 · 0 评论 -
Linux下用dd命令测试硬盘的读写速度
http://zhangge.net/4172.html转载 2015-10-29 14:39:39 · 494 阅读 · 0 评论 -
清理linux的缓冲
修改drop_cachesecho 1 > /proc/sys/vm/drop_caches等清理完,重置回来echo 0 > /proc/sys/vm/drop_caches原创 2016-12-21 13:12:29 · 337 阅读 · 0 评论 -
linux du的使用
du -h --max-depth=1 /home列出/home目录下所有文件和目录的大小原创 2017-01-03 15:32:13 · 271 阅读 · 0 评论 -
/etc/crontab文件和crontab -e命令区别
http://www.cnblogs.com/xd502djj/p/4292781.html原创 2017-06-29 15:14:47 · 6079 阅读 · 0 评论 -
linux中vi的使用
在编辑模式中,采用:r命令读取文件内容到当前缓冲区 文本替换:1,5 s/Spark/spark/g:% s/\<the\>/The/g原创 2017-05-04 14:45:02 · 352 阅读 · 0 评论 -
Linux之find
http://www.oracle.com/technetwork/cn/topics/calish-find-096463-zhs.htmlfind . -name "*.java" 下面是该命令所找到的命令的缩略清单:find . -name "*.java"./REGEXPvalidate/src/oracle/otnsamples/plsql/ConnectionManager.ja原创 2017-03-04 17:14:05 · 577 阅读 · 0 评论 -
在vim中移动光标
1.移动到某个特定字符 采用fx命令进行字符定位,例如fs可以定位到同一行s下一次现出的位置。 采用Fx命令,可以将光标定位到x字符在同一行上一次出现的位置 2.按word进行移动 使用w或nw将光标向前移动。其中n为数字。 使用b或nb将光标向后移动。其中n为数字。 3.新行输入 o表示在当行下的下方创建一个新行,O表示在当前行的上方打开一个新行//O在光标所在行的上方插入新行【原创 2017-05-03 18:47:37 · 462 阅读 · 0 评论 -
Linux Shell中的$#、$@、$0
http://www.jianshu.com/p/03b6fa705a82原创 2017-04-21 17:05:41 · 571 阅读 · 0 评论 -
linux dirname的使用
http://www.cnblogs.com/kevingrace/p/6182573.html原创 2017-04-21 16:56:41 · 479 阅读 · 0 评论 -
linux之sed
http://www.runoob.com/linux/linux-comm-sed.html原创 2017-03-16 18:36:10 · 386 阅读 · 0 评论 -
linux之awk
http://www.runoob.com/linux/linux-comm-awk.html原创 2017-03-09 15:53:42 · 530 阅读 · 0 评论 -
linux只uniq
http://os.51cto.com/art/201107/274991.htm原创 2017-03-09 15:30:43 · 287 阅读 · 0 评论 -
linux之cut
http://www.cnblogs.com/dong008259/archive/2011/12/09/2282679.html原创 2017-03-09 14:58:14 · 767 阅读 · 0 评论 -
阿里云centos开启ipv6支持
http://coolnull.com/4474.html http://www.jianshu.com/p/1223d2ad6f30原创 2017-02-18 21:15:11 · 7968 阅读 · 3 评论 -
安装gem How To Install Ruby on Rails on CentOS 6
下边的文章介绍的很好 https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-on-centos-6原创 2017-02-17 15:40:28 · 442 阅读 · 0 评论 -
linux软连接和硬链接
http://www.cnblogs.com/micrari/p/5716851.html原创 2017-02-05 16:59:33 · 315 阅读 · 0 评论 -
查看linux上的内存
[superuser@vm bin]$ free -h total used free shared buffers cachedMem: 3.7G 3.5G 213M 356K 268M 1.9G-/+ buffers/cache:原创 2017-01-05 11:22:39 · 493 阅读 · 0 评论 -
Linux下查看CPU信息[/proc/cpuinfo]
http://blog.youkuaiyun.com/sycflash/article/details/6643492转载 2015-09-25 17:19:40 · 453 阅读 · 0 评论 -
AWK 简明教程
http://coolshell.cn/articles/9070.html转载 2015-07-12 16:59:59 · 415 阅读 · 0 评论 -
CentOS 修改主机名
from http://www.cnblogs.com/mawanglin2008/p/3530790.html2.永久修改主机名以上的修改只是临时修改,重启后就恢复原样了。步骤1:修改/etc/sysconfig/network中的hostnamevi /etc/sysconfig/network HOSTNAME=localhost.localdomain #修改localhost.loca原创 2015-07-02 16:32:04 · 469 阅读 · 0 评论 -
CentOS安装Maven
centos安装maven转载 2015-01-07 15:06:01 · 460 阅读 · 0 评论 -
linux 中的find命令
find是最常见和最强大的查找命令,你可以用它找到任何你想找的文件。find的使用格式如下: $ find - : 所要搜索的目录及其所有子目录。默认为当前目录。 - : 所要搜索的文件的特征。 - : 对搜索结果进行特定的处理。如果什么参数也不加,find默认搜索当前目录及其子目录,并且不过滤任何结果(也就是返回所有文件),将它们原创 2014-11-06 14:06:53 · 565 阅读 · 0 评论 -
localhost: ssh: connect to host localhost port 22: Connection timed out
/etc/hosts中没有配置localhost原创 2014-11-05 22:27:01 · 2212 阅读 · 0 评论 -
查看centos版本
cat /etc/issue原创 2014-11-05 20:21:36 · 495 阅读 · 0 评论 -
U盘安装 CentOS 7
http://blog.youkuaiyun.com/gaohuaid/article/details/38750283转载 2014-10-06 10:32:40 · 567 阅读 · 0 评论