Fork me on GitHub

随笔分类 -  Linux

摘要:一、阿里云镜像站: https://developer.aliyun.com/mirror/ 二、网易: http://mirrors.163.com/ 三、教育网主要镜像站: http://mirrors.neusoft.edu.cn/ 四、北京外国语大学开源软件镜像站: https://mirr 阅读全文
posted @ 2021-08-05 11:14 Alex-Lzy 阅读(574) 评论(0) 推荐(0) 编辑
摘要:Centos 6 一、 init 1 切换单用户模式 passwd 按提示输入两遍密码(centos 7直接切换init 1 需要root密码6不需要密码) 二、 开机按任意键 输入字母 a 输入single | s | S | 1 切换单用户4选一 passwd 按提示输入两遍密码 (centos 阅读全文
posted @ 2020-07-24 20:51 Alex-Lzy 阅读(791) 评论(0) 推荐(0) 编辑
摘要:1 1 #!/bin/bash 2 2 # 3 3 # chkconfig: - 98 3 #开机默认不启动s98 k3 4 4 # description: test service #描述,是个测试服务 5 5 6 6 . /etc/init.d/functions #调用 函数 7 7 8 8 阅读全文
posted @ 2020-07-23 16:41 Alex-Lzy 阅读(202) 评论(0) 推荐(0) 编辑
摘要:Sed: 演示文件: passwd -n 关闭自动打印 开头 ^ 空行 ^$ 结尾或最后一行$ p 打印 1 sed 'p' passwd 默认自动打印,p重复操作 2 sed -n 'p' passwd 自动打印不做,p继续打印 3 sed -n '2p' passwd 关闭自动打印,只打第2行 阅读全文
posted @ 2020-07-17 14:30 Alex-Lzy 阅读(744) 评论(0) 推荐(0) 编辑
摘要:一、CentOS 6默认安装好之后是没有自动开启网络连接的 二、默认IP图片: 三、修改配置文件 文件路径: /etc/sysconfig/network-scripts/ifcfg-eth0vim /etc/sysconfig/network-scripts/ifcfg-eth0 使用vim打开之 阅读全文
posted @ 2020-04-23 11:35 Alex-Lzy 阅读(7225) 评论(0) 推荐(0) 编辑
摘要:1、简述osi七层模型和TCP/IP五层模型 OSI参考模型 各层的解释 TCP/IP五层模型 应用层 为应用程序提供服务 应用层 表示层 数据格式转化,数据加密 会话层 建立管理和维护会话 传输层 建立,管理和维护端到端的连接 传输层 网络层 IP选址及路由选择 网络层 数据链路层 提供介质访问和 阅读全文
posted @ 2020-04-13 14:23 Alex-Lzy 阅读(201) 评论(0) 推荐(0) 编辑
摘要:1、lsof -a /data/test.txt #通过lsof -a 查看到less 在使用这个文件 2、 lsof |grep delete #lsof 可以查看到所有正在运行的进程,grep 过滤出删除的delete。 3、记住进程编号“9903” 4、ll /proc/9903/fd #fd 阅读全文
posted @ 2019-12-31 16:43 Alex-Lzy 阅读(904) 评论(0) 推荐(0) 编辑
摘要:一 、自建yum仓库,分别为网络源和本地源 [base]name=cdrom basebaseurl=file:///misc/cdgpgcheck=0 [epel]name=aliyun epelbaseurl=https://mirrors.aliyun.com/epel/$releasever 阅读全文
posted @ 2019-12-24 11:16 Alex-Lzy 阅读(150) 评论(0) 推荐(0) 编辑
摘要:1、创建用户脚本 #!/bin/bash##********************************************************************#Author: 小汤圆#: #Date: 2019-12-04#FileName: CreateUser.sh#URL 阅读全文
posted @ 2019-12-05 17:59 Alex-Lzy 阅读(350) 评论(0) 推荐(0) 编辑
摘要:1、创建用户脚本 #!/bin/bash##********************************************************************#Author: 小汤圆#: #Date: 2019-12-04#FileName: CreateUser.sh#URL 阅读全文
posted @ 2019-12-04 13:20 Alex-Lzy 阅读(134) 评论(0) 推荐(0) 编辑
摘要:1、查找/etc目录下大于1M且类型为普通文件的所有文件 find /etc/ -size +1M -type f 2、打包/etc/目录下面所有conf结尾的文件,压缩包名称为当天的时间,并拷贝到/usr/local/src目录备份。 find /etc/ -type f -name "*.con 阅读全文
posted @ 2019-12-02 09:42 Alex-Lzy 阅读(107) 评论(0) 推荐(0) 编辑
摘要:cd:cd /data 切换文件夹到/data cd ..回到上级文件夹 cd ~ 回到家目录 cd 默认回到家目录cd - 回到刚刚离开的目录(只能回一次) pwd 显示当前目录路径 time 后面跟命令,可以显示命令的执行时间(可以用来比较两个命令的执行快慢) ls 和ll:ls 列出当前目录下 阅读全文
posted @ 2019-11-29 11:35 Alex-Lzy 阅读(469) 评论(0) 推荐(0) 编辑
摘要:首先是看centos7的防火墙的状态,查看的命令为: sudo systemctl status firewalld。 查看后,看到active(running)就意味着防火墙打开了, 如果想关闭防火墙,命令为: sudo systemctl stop firewalld。 关闭后查看是否关闭成功, 阅读全文
posted @ 2019-11-29 10:42 Alex-Lzy 阅读(10963) 评论(0) 推荐(0) 编辑
摘要:恢复内容开始 1、统计出/etc/passwd文件中其默认shell为非/sbin/nologin的用户个数,并将用户都显示出来 awk -F: '{shells[$NF]++;if($NF == "/sbin/nogin"){print $1,$NF}}END{for(i in shells){p 阅读全文
posted @ 2019-11-25 17:13 Alex-Lzy 阅读(98) 评论(0) 推荐(0) 编辑
摘要:cp /etc/profile /tmp/ cat /tmp/profile |tr d ' 阅读全文
posted @ 2019-11-19 16:01 Alex-Lzy 阅读(624) 评论(0) 推荐(0) 编辑
摘要:vim中设置tab缩进为4个字符 set tabstop=4 阅读全文
posted @ 2019-11-18 14:46 Alex-Lzy 阅读(968) 评论(0) 推荐(0) 编辑