
linux
yjz764297625
这个作者很懒,什么都没留下…
展开
-
ubuntu下使用crontab命令定时执行java程序
Test.java代码如下:[code="java"]import java.util.Date;public class Test { public static void main(String[] args) { System.out.println((new Date()).toString()); System.out.println(...原创 2013-08-25 19:55:38 · 170 阅读 · 0 评论 -
查看占用指定端口的进程
口2181是被zookeeper占用了原创 2016-12-19 21:28:19 · 217 阅读 · 0 评论 -
ssh secure shell链接linux服务器时弹出Server responded "Algorithm negotiation failed"解决
9dc1f68.png[/img]解决方案:在/etc/ssh/sshd_config后面添加[code="java"]Ciphers aes128-cbc,aes192-cbc,aes256-cbc,blowfish-cbc,arcfourKexAlgorithms diffie-hellman-group1-sha1[/code]重启 ssh服务之后就可以连接了原创 2016-04-26 19:11:04 · 201 阅读 · 0 评论 -
第一个shell脚本
total=0for((index = 0; index < 5; index++)) do let total=$[$total + $index] echo "current total = $total" done echo "at last total = $total"[/code]运行结果:[code="java"]yangjianzhou@OptiPl原创 2015-12-26 00:48:29 · 108 阅读 · 0 评论 -
ubuntu下使用crontab命令定时执行java程序
t.println("==================begin================="); for(int i=1;i> test.log#将Test.java中所有的打印输入(System.out.print())都输出到test.log文件中[/code]指定定时程序,在控制台上输入 crontab -l输入如下内容:[code="java"]crontab -l */1 * * * * date原创 2013-08-25 19:55:38 · 81 阅读 · 0 评论 -
统计指定目录下指定类型文件的行数
需求:通知指定项目下面指定类型文件(java、properties、xml等)的行数 关键代码:#!/bin/bash#统计指定目录下面指定类型文件的行数targetDirFile=$1;fileType="*."$2; totalLines=0;while read linedo let count=$(find $line -type f -...原创 2017-05-17 00:37:15 · 332 阅读 · 0 评论 -
第一个shell脚本
第一个shell脚本,直接上脚本[code="java"]# /bin/sh#if test $# -eq 0#then# echo "please input file name :"#else# rm -rf $1# echo "file $1 is deleted!"#fideclare total=0for((index =...原创 2015-12-26 00:48:29 · 103 阅读 · 0 评论 -
查看占用指定端口的进程
根据端口号,查找对应的进程,具体如下:1、netstat -alp | grep 2181 2、根据得到的进程号3567去获取具体的进程:ps -aux | grep 3567 3、我们得到端口2181是被zookeeper占用了...原创 2016-12-19 21:28:19 · 258 阅读 · 0 评论 -
ssh secure shell链接linux服务器时弹出Server responded "Algorithm negotiation failed"解决方案...
问题:ssh secure shell链接linux服务器时弹出Server responded "Algorithm negotiation failed" 错误。[img]http://dl2.iteye.com/upload/attachment/0116/9959/971edc7e-320c-3e06-bfb3-1964a9dc1f68.png[/img]解决方案:...原创 2016-04-26 19:11:04 · 1289 阅读 · 0 评论 -
统计指定目录下指定类型文件的行数
;fileType="*."$2; totalLines=0;while read linedo let count=$(find $line -type f -name "$fileType" | xargs cat | wc -l); let totalLines=$totalLines+$count;done < $targetDirFileecho "total lines of type fi原创 2017-05-17 00:37:15 · 170 阅读 · 0 评论