随笔分类 -  shell

摘要:转至:https://cloud.tencent.com/developer/article/1068328 Linux系统LVM逻辑卷创建过程以及自动化脚本 2018-03-21阅读 6300 最近在上海新建机房的时候,给了我 2 台 M2 机型服务器,在做初始化的时候发现有一堆磁盘: [root 阅读全文
posted @ 2020-07-30 16:49 study_goup 阅读(445) 评论(0) 推荐(0) 编辑
摘要:转至:https://blog.csdn.net/dieman0446/article/details/102370767?utm_medium=distribute.pc_relevant_download.none-task-blog-blogcommendfrombaidu-1.nonecas 阅读全文
posted @ 2020-07-29 13:07 study_goup 阅读(607) 评论(0) 推荐(0) 编辑
摘要:转至:https://blog.csdn.net/weixin_40816738/article/details/105244851 ① 脚本编写创建脚本 vim closeFirewall.sh 添加脚本内容如下: if egrep "7.[0-9]" /etc/redhat-release &> 阅读全文
posted @ 2020-07-29 10:59 study_goup 阅读(1258) 评论(0) 推荐(0) 编辑
摘要:转至:https://blog.csdn.net/weixin_34409357/article/details/89833777?utm_medium=distribute.pc_relevant.none-task-blog-BlogCommendFromMachineLearnPai2-1.c 阅读全文
posted @ 2020-07-29 10:51 study_goup 阅读(552) 评论(0) 推荐(0) 编辑
摘要:转至:https://blog.csdn.net/onionm/article/details/100514892?utm_medium=distribute.pc_relevant_download.none-task-blog-baidujs-1.nonecase&depth_1-utm_sou 阅读全文
posted @ 2020-07-29 10:36 study_goup 阅读(886) 评论(0) 推荐(0) 编辑
摘要:转至:https://www.jb51.net/article/79466.htm #!/bin/sh #****************************************************************** # File: oraclebak.sh # Creatio 阅读全文
posted @ 2020-07-28 16:37 study_goup 阅读(1323) 评论(0) 推荐(0) 编辑
摘要:转至:http://www.178linux.com/87745 1、列出当前系统上所有已经登录的用户的用户名,注意:同一个用户登录多次,则只显示一次即可。 2、取出最后登录到当前系统的用户的相关信息。 3、取出当前系统上被用户当做其默认shell的最多的那个shell。 4、将/etc/passw 阅读全文
posted @ 2020-07-28 12:37 study_goup 阅读(184) 评论(0) 推荐(0) 编辑
摘要:转至:http://www.178linux.com/88128 vim编辑器的使用总结: vim在工作过程当中有三种模式:编辑模式、输入模式、末行模式。 1、编辑模式:即命令模式,键盘操作常被理解为编辑命令; 2、输入模式:在文本文件当中进行输入内容; 3、末行模式:vim内置的命令行接口,执行v 阅读全文
posted @ 2020-07-28 12:34 study_goup 阅读(321) 评论(0) 推荐(0) 编辑
摘要:转至:http://www.178linux.com/88910 一、请详细描述CentOS系统的启动流程(详细到每个过程系统做了哪些事情) 第一步:POST加电自检 主要实现的功能是检测各个外围硬件设备是否存在而且能够正常运行起来,实现这一自检功能的是固化在主板上的ROM(主要代表为CMOS)芯片 阅读全文
posted @ 2020-07-28 12:33 study_goup 阅读(250) 评论(0) 推荐(0) 编辑
摘要:转至:http://www.178linux.com/88838 1、写一个脚本,判断当前系统上所有用户的shell是否为可登录shell(即用户的shell不是/sbin/nologin);分别这两类用户的个数;通过字符串比较来实现; 2、写一个脚本 (1) 获取当前主机的主机名,保存于hostn 阅读全文
posted @ 2020-07-28 12:32 study_goup 阅读(200) 评论(0) 推荐(0) 编辑
摘要:转至:http://www.178linux.com/88405 1、创建一个10G分区,并格式为ext4文件系统 a) 要求其block大小为2048,预留空间百分比为2,卷标为MYDATA,默认挂载属性包含acl; ~]# mke2fs –t ext4 –b 2048 –m 2 –L MYDAT 阅读全文
posted @ 2020-07-28 12:31 study_goup 阅读(184) 评论(0) 推荐(0) 编辑
摘要:转至:http://www.178linux.com/88406 1、写一个脚本,使用ping命令探测172.16.250.1-172.16.250.254之间的所有主机的在线状态 在线的主机使用绿色显示 不在线的主使用红色显示 #!/bin/bash # for i in {1..254};do 阅读全文
posted @ 2020-07-28 12:29 study_goup 阅读(278) 评论(0) 推荐(0) 编辑
摘要:转至:https://www.jianshu.com/p/b88c7e07aaa9 linux中()、[]、{}、(())、[[]]等各种括号的使用 1、小括号、圆括号() 1.1 单小括号() 命令组。括号中的命令将会新开一个子shell顺序执行,所以括号中的变量不能够被脚本余下的部分使用。括号中 阅读全文
posted @ 2020-07-28 12:26 study_goup 阅读(4208) 评论(0) 推荐(0) 编辑
摘要:转至:https://blog.csdn.net/dj0379/article/details/50946398/ declare -i iv=$svnvlet iv+=1shell中变量自增的实现方法Linux Shell中写循环时,常常要用到变量的自增,现在总结一下整型变量自增的方法。我所知道的 阅读全文
posted @ 2020-07-28 12:24 study_goup 阅读(2690) 评论(0) 推荐(0) 编辑
摘要:转至:https://blog.csdn.net/qq_22083251/article/details/80484176 循环中的重定向 或许你应该在其他脚本中见过下面的这种写法: while read line do … done < file 刚开始看到这种结构时,很难理解< file是如何与 阅读全文
posted @ 2020-07-28 09:14 study_goup 阅读(374) 评论(0) 推荐(0) 编辑
摘要:用shell编写的一个脚本,执行的时候报错:syntax error: unexpected end of file! 发生这种报错有两种原因: 第一种: 如果你是用 windows 系统编写的脚本,那么就有可能是 fileformat 类型不同!可能是 fileformat=dos ,那么你需要把 阅读全文
posted @ 2020-07-27 15:11 study_goup 阅读(5474) 评论(0) 推荐(0) 编辑
摘要:Linux利用nc命令脚本批量检测服务器指定端口是否开放 一、nc命令检测端口的用法 # nc -v -w 10 %IP% -z %PORT% -v 显示指令执行过程。 -w <超时秒数> 设置等待连线的时间。 -u 表示使用UDP协议 -z 使用0输入/输出模式,只在扫描通信端口时使用。 例如:检 阅读全文
posted @ 2020-07-27 13:44 study_goup 阅读(1716) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示