Summer's Blog
😈酷炫主页
✨运维
🎉安装
👀踩坑
  • k8s
  • shell
  • python
  • redis
  • elasticsearch
  • mysql
  • ceph
  • spark
  • 关于
  • 思维
  • 命令
  • 友链
  • 分类
  • 标签
  • 归档
👨‍👩‍👦‍👦腾讯云社区
🗣GitHub

Summer———夏苏文

💨运维界的前行者
😈酷炫主页
✨运维
🎉安装
👀踩坑
  • k8s
  • shell
  • python
  • redis
  • elasticsearch
  • mysql
  • ceph
  • spark
  • 关于
  • 思维
  • 命令
  • 友链
  • 分类
  • 标签
  • 归档
👨‍👩‍👦‍👦腾讯云社区
🗣GitHub
  • K8s

  • shell

    • 自动重启应用脚本
    • 自动重启docker脚本
    • 安装java脚本
    • 安装mysql脚本
    • 安装elasticsearch脚本
    • 安装redis脚本
    • 清理docker日志脚本
    • 钉钉报警脚本
    • 彩色进度条脚本
    • 奇数行和偶数行合并
    • 备份mysql脚本
    • cpu硬盘报警脚本
    • 安装node-exporter脚本
    • 批量ping探测网段ip
    • 一键安装VNC脚本
    • ssh免密登录脚本
    • 创建10个文件并写入内容
      • 执行效果
    • 模拟linux内存占用脚本
  • spark

  • Python

  • Redis

  • ceph

  • Elasticsearch

  • Mysql

  • 学习
  • shell
summer
2021-12-09

创建10个文件并写入内容

# 执行效果

root in jCeXjfniZtN in / 
➜ mkdir test10
root in jCeXjfniZtN in / 
➜ cd test10/
root in jCeXjfniZtN in /test10 
➜ vim test.sh
root in jCeXjfniZtN in /test10 took 5s 
➜ cat test.sh 
#!/bin/bash
for ((i=1; i<11; i++));
do
   touch test$i.txt
done                               
for file in test1.txt test2.txt test3.txt test4.txt test5.txt test6.txt test7.txt test8.txt test9.txt test10.txt
do
echo -e "11 22\n11 22\n11 22\n11 22\n11 22\n11 22\n11 22\n11 22\n11 22\n11 22" >> $file
done
root in jCeXjfniZtN in /test10 
➜ ll
total 4
-rw-r--r-- 1 root root 304 Dec  9 14:40 test.sh
root in jCeXjfniZtN in /test10 
➜ sh test.sh 
root in jCeXjfniZtN in /test10 
➜ ll
total 44
-rw-r--r-- 1 root root  60 Dec  9 14:40 test10.txt
-rw-r--r-- 1 root root  60 Dec  9 14:40 test1.txt
-rw-r--r-- 1 root root  60 Dec  9 14:40 test2.txt
-rw-r--r-- 1 root root  60 Dec  9 14:40 test3.txt
-rw-r--r-- 1 root root  60 Dec  9 14:40 test4.txt
-rw-r--r-- 1 root root  60 Dec  9 14:40 test5.txt
-rw-r--r-- 1 root root  60 Dec  9 14:40 test6.txt
-rw-r--r-- 1 root root  60 Dec  9 14:40 test7.txt
-rw-r--r-- 1 root root  60 Dec  9 14:40 test8.txt
-rw-r--r-- 1 root root  60 Dec  9 14:40 test9.txt
-rw-r--r-- 1 root root 304 Dec  9 14:40 test.sh
root in jCeXjfniZtN in /test10 
➜ cat test10.txt 
11 22
11 22
11 22
11 22
11 22
11 22
11 22
11 22
11 22
11 22
root in jCeXjfniZtN in /test10 
➜ 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#shell
上次更新: 12/9/2021, 3:29:51 PM
ssh免密登录脚本
模拟linux内存占用脚本

← ssh免密登录脚本 模拟linux内存占用脚本→

最近更新
01
ceph块设备使用iscsi
03-29
02
Citrix设置vm开机自启动
02-17
03
ntp与chrony时间同步
12-17
更多文章>
Theme by Vdoing | Copyright © 2019-2023 夏苏文 | MIT License

网站已在灾难中运行:

蜀ICP备2022029853号-1
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式