摘要: GREP用法 grep “after” profile #查找文件内的包含after单词的行 grep -n "after" profile #添加查找的行在文档的行号 grep -v "after" profile #查找文件内的不包含after单词的行 匹配符: \ 转义字符 . 匹配任意单个字 阅读全文
posted @ 2021-10-04 13:00 程胥员 阅读(80) 评论(0) 推荐(0)
摘要: 文本操作 查找文件: # find 大概位置 以名字查找 名字 find /etc/ -name i18n find /etc/ -name 70* find /etc/ -name 70*net* 查找文件: whereis java --> java: /usr/bin/java 查找文本 /k 阅读全文
posted @ 2021-10-04 12:54 程胥员 阅读(92) 评论(0) 推荐(0)
摘要: 文件的压缩与打包 常用文件拓展名 *.tar.gz tar程序打包的文件,并且经过gzip的压缩 *.tar.bz2 tar程序打包的文件,并且经过bzip2的压缩 tar 命令,选项与参数: -c :建立打包文件 -t : 查看打包文件的内容含有哪些文件 -x : 解打包或解压缩的功能,可以搭配 阅读全文
posted @ 2021-10-04 12:54 程胥员 阅读(365) 评论(0) 推荐(0)
摘要: 条件分支 if-else-fi [root@node1 test]# vim if.sh #!/bin/bash amswer=30 if [ $1 -gt $answer ];then echo "对不起,您猜大了!" elif [ $ -lt $answer ];then echo "对不起,您 阅读全文
posted @ 2021-10-04 12:53 程胥员 阅读(36) 评论(0) 推荐(0)
摘要: linux中软件的安装方式 四种方式 ​ 源码编译安装 ​ rpm安装 ​ yum安装 解压、配置(hadoop、hive等) 1.源码编译安装 1.为了编译nginx源码 yum install gcc gcc-c++ -y 2.用于支持https协议 yum install openssl op 阅读全文
posted @ 2021-10-04 12:52 程胥员 阅读(133) 评论(0) 推荐(0)
摘要: 软件负载均衡 软件负载均衡成本几乎为零,基本都是开源软件。例如:LVS、HAProxy、Nginx等。 该机群包含一台Nginx服务器,两台Web服务器(node2和node3) 软件负载均衡之--httpd 修改nginx.conf文件 upstream rss{ server 192.168.4 阅读全文
posted @ 2021-10-04 12:52 程胥员 阅读(322) 评论(0) 推荐(0)
摘要: 挂载mount 1.查看系统挂载的磁盘情况 df df -h 2.挂载:mount 将光驱挂在到/mnt目录: mount /dev/cdrom /mnt #mount 准备挂载的块 目标目录 进入到 /mnt 目录 cd /mnt 查看磁盘分区的挂载情况: df -h 3.umount 卸载掉 挂 阅读全文
posted @ 2021-10-04 12:51 程胥员 阅读(182) 评论(0) 推荐(0)
摘要: vi和vim文本编辑器 vi和vim模式的相互切换 快捷键使用案例 拷贝当前行yy; 拷贝当前行向下的5行 5yy; 并粘贴(p) 删除当前行dd; 删除当前行向下的5行 5dd ; 删除光标下面的所有行 dG 删除贯标下面所有行(保留最后一行) :.,$-1d 在文件中查找某个单词:命令行下 /关 阅读全文
posted @ 2021-10-04 12:50 程胥员 阅读(36) 评论(0) 推荐(0)
摘要: Nginx参数详解 第一部分:全局块 ​ 从配置文件到events之间的内容,主要会设置一些影响nginx服务器整体运行的配置命令。主要包括配置运行nginx服务器的用户(组)、允许生成的worker process数,进程pid存放路径、日志存放路径和类型以及配置文件的引入等。 #user adm 阅读全文
posted @ 2021-10-04 12:49 程胥员 阅读(353) 评论(0) 推荐(0)
摘要: nginx安装配置步骤 1.安装基本软件 ​ yum install gcc gcc-c++ pcre pcre-devel openssl openssl-devel zlib zlib-devel -y 2.创建存放源文件的文件夹 [root@nginx1 apps]# cd /opt/ [ro 阅读全文
posted @ 2021-10-04 12:48 程胥员 阅读(420) 评论(0) 推荐(0)
摘要: Location\httpd\反向代理 参考:http://tengine.taobao.org/nginx_docs/cn/docs/http/ngx_http_core_module.html 测试 在没安装nginx的虚拟机上安装httpd服务 [root@node2 ~]# yum inst 阅读全文
posted @ 2021-10-04 12:47 程胥员 阅读(71) 评论(0) 推荐(0)
摘要: Nginx—location配置 编辑nginx.conf文件 #user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.l 阅读全文
posted @ 2021-10-04 12:47 程胥员 阅读(69) 评论(0) 推荐(0)
摘要: Linux用户和用户组 1.添加新的用户 (用户ID从500开始,0-99系统管理级别、100-499系统预留) useradd 选项 用户名 参数说明 选项: -c comment 指定一段注释性描述 -d 目录 指定用户主目录,如果此目录不存在,则同时使用-m选项,可以创建主目录 -g 用户组 阅读全文
posted @ 2021-10-04 12:46 程胥员 阅读(55) 评论(0) 推荐(0)
摘要: Linux虚拟机上按安装jdk1.8.0 1.准备工作 jdk1.8.0下载地址: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 将jdk上传到Linux指定目录/usr/jav 阅读全文
posted @ 2021-10-04 12:45 程胥员 阅读(212) 评论(0) 推荐(0)
摘要: Linux文件属性及权限 首先我们以root用户的身份登录linux,执行ls -al 查看文件: 文件类型: 【d】 代表目录(directory)、【-】代表文件、【l】代表链接文件(link)、【b】代表块设备(block) rwd 【r】代表可读(read)、【w】代表可写(write)、【 阅读全文
posted @ 2021-10-04 12:44 程胥员 阅读(102) 评论(0) 推荐(0)
摘要: 命令入门 命令提示符详解 find cut sort wc sed aws [root@localhost ~]# # /root [lilei@node1 ~]$ #/home/lilei 用户名@主机名 当前目录 #系统权限 $普通权限 1. ls 命令 ls -a # 显示所有数据 ls -l 阅读全文
posted @ 2021-10-04 12:43 程胥员 阅读(54) 评论(0) 推荐(0)
摘要: Linux的安装和网络配置 CentOS7安装教程 https://www.php.cn/centos/472898.html 1.虚拟网络编辑器配置 通过VMware菜单栏,依次点击编辑和虚拟网络编辑器 选中VMnet8取消勾选本地DHCP服务将IP地址分配给虚拟机,查看DHCP确保未启用 点击N 阅读全文
posted @ 2021-10-04 12:42 程胥员 阅读(124) 评论(0) 推荐(0)
摘要: Linux关于防火墙的命令 一、red hat/CentOs7关闭防火墙的命令 查看防火墙状态 systemctl status firewalld service iptables status 暂时关闭防火墙 systemctl stop firewalld service iptables s 阅读全文
posted @ 2021-10-04 12:42 程胥员 阅读(260) 评论(0) 推荐(0)
摘要: grep 基本匹配: grep a*re hello.txt --* 代表多个任意字符 grep a.re hello.txt -- .代表re前面任意多个a grep "...re" hello.txt --打印re前面有三个字符的字符串 grep '[xz]k' hello.txt --打印k前 阅读全文
posted @ 2021-10-04 12:40 程胥员 阅读(163) 评论(0) 推荐(0)
摘要: I/O 重定向不是命令 程序自身都有I/O 0: 标准输入 1: 标准输出 2:错误输出 控制程序I/O位置 一切皆文件 /proc/$$/fd 程序是否处理I/O 重定向绑定顺序:从左到右 ls / /hello 1 > log.out #正确输出结果导入到log.out中 ls / /hello 阅读全文
posted @ 2021-10-04 12:40 程胥员 阅读(102) 评论(0) 推荐(0)