![](https://img-blog.csdnimg.cn/20190422160350739.jpeg?x-oss-process=image/resize,m_fixed,h_224,w_224)
Linux 入门到进阶
文章平均质量分 88
Linux基础知识,基本操作及其讲解。以及性能分析等
songyuequan
这个作者很懒,什么都没留下…
展开
-
shell 编程概要
背景运维:目标:保障系统长期、稳定、安全运行工作内容;安装、配置、备份、监控、邮件报警、自动报警、物理世界CPU内存网卡磁盘资源角度计算存储网络一. 什么是shell脚本语言查看所有的脚本cat /etc/shells 做什么自动化批量系统初始化 (update,软件安装,时区设置,安全策略,防火墙、端口转发等)自动化批量软件部署 (LAMP,Tomcat,Nginx)管理应用程序自动化备份恢复程序(MySQL 完全、增量备份)原创 2021-01-17 13:10:31 · 213 阅读 · 0 评论 -
Linux重命名root用户
vim /etc/passwd 将第一行的第一个root替换为重命名的用户root:x:0:0:root:/root:/bin/bashvim /etc/shadow 将这一行中的root 替换为重命名的用户root:$xxxxxxxxxx:18186:0:99999:7:::exit使用重命名后的用户登录id 查看当前用户id 为0 即是修改成功,...原创 2020-05-07 00:06:44 · 5397 阅读 · 0 评论 -
sed 引用shell变量
1. 如果sed 命令使用的是 单引号,引用变量要使用 $+单引号+双引号 的方式。例子如下addrs=`/sbin/ifconfig -a|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d "addr:"`sed 's/localhost:1935/'"$addrs"':1935/g' filename...原创 2020-01-09 16:36:29 · 1985 阅读 · 0 评论 -
vim 和 sed 对比
sed 是一个流编辑器 (stream editor),而vim 是一个交互式编辑器,理论上来讲vim 可以完成的功能 sed 都可以完成。我们将 vim 和 sed 做一个大致的对比:vimsedi进入插入模式并在前面插入内容sed '/ab/i hello' bfile —— 匹配到’ab’后在上一行插入a进入插入模式并在后面插入内容sed ...原创 2019-12-12 22:23:05 · 1477 阅读 · 0 评论 -
使用Clonezilla 复制Linux操作系统
关于Clonezilla的介绍https://clonezilla.org/clonezilla-live.php下载Clonezillahttps://clonezilla.org/downloads/download.php?branch=stable使用Tuxboot 制作 Clonezilla 启动U盘https://tuxboot.org将磁盘保存为镜像https://c...原创 2019-11-30 15:53:58 · 429 阅读 · 0 评论 -
Ubuntu 18.04 修改主机名
ubuntu 18.04不能直接修改/etc/hostname中主机名称,重启后又恢复到安装时设置的主机名称.正确的修改步骤如下:1.首先修改/etc/cloud/cloud.cfgsudo vim /etc/cloud/cloud.cfg找到preserve_hostname: false修改为preserve_hostname: true2.修改主机名(永久)#修改主机名(临时)...转载 2019-10-22 13:35:49 · 616 阅读 · 0 评论 -
Vim 普通模式下各个键的功能
1.Normal Modemotion : 运动operation : 操作amotion: appendAmotion: append at the end of lineCtrl+amake the number add one for example: 1 to 2bmotion: to move the cursor to the first letter of the...原创 2019-07-02 11:02:33 · 7415 阅读 · 0 评论 -
Vim 常用命令
windowCtrl+w+operationw : switch to nextc : closen : news : split horizontalv : vsplit verticalj k h l : move to another window [down] [up] [left] [right]some comman...原创 2019-07-02 10:58:27 · 505 阅读 · 0 评论 -
VIM 速查卡
最近根据陈皓(网名:左耳朵耗子)大神的 简明 VIM 练级攻略练习了一下VIM。感觉良好。所以把VIM 速查卡放在这里。以便随时查阅。勤加练习。基本的操作熟练之后,建议大家把自己的IDE都装上VIM插件。注:图片来自于http://michael.peopleofhonoronly.com/vim/...原创 2019-01-22 20:45:21 · 237 阅读 · 0 评论 -
Ubuntu LTS 18.04 配置DHCP Server
1. 安装DHCP服务apt install isc-dhcp-server2. 修改网络规划vim /etc/netplan/50-cloud-init.yaml/etc/netplan/50-cloud-init.yaml-双网卡设备enpls0 作为DHCP Clientenx000ec6b88013 作为DHCP Server , dhcp4: false.配置IP地址...原创 2019-04-21 19:12:05 · 10607 阅读 · 1 评论 -
Ubuntu LTS 18.04 配置路由转发
以下命令都是root用户执行1.开启ip转发Linux系统缺省并没有打开IP转发功能执行 cat /proc/sys/net/ipv4/ip_forward可以看到内容为 0此时,执行下面的命令echo 1 > /proc/sys/net/ipv4/ip_forward再次查看【ip_forward】的内容cat /proc/sys/net/ipv4/ip_forwa...原创 2019-04-28 15:42:45 · 11497 阅读 · 0 评论 -
Ubuntu LTS 18.04设置静态IP
/etc/netplan/*.yml# This file is generated from information provided by# the datasource. Changes to it will not persist across an instance.# To disable cloud-init's network configuration capabil...原创 2019-07-04 12:03:25 · 231 阅读 · 0 评论 -
Ubuntu Server LTS 18.04 安装ssh服务
安装sshdapt nstall openssh-server编辑配置文件,在最后一行添加密码认证vim /etc/ssh/sshd_configPasswordAuthentication yes在#PermitRootLogin prohibit-password后面添加一行PermitRootLogin yes重启sshservice ssh star...原创 2019-04-21 19:16:01 · 974 阅读 · 0 评论 -
Linux 性能工具图谱
今天分享一张图片,Linux Performance Tools. 是极客时间中《Linux性能优化实战》专栏第一讲介绍的。这张图是性能领域的大师 伦丹·格雷格(Brendan Gregg)制作的。而他本人也是动态追踪工具DTrace的作者.早期听大神章亦春(OpenResty)分享过动态追踪技术(Dynamic Tracing)。下面的链接是根据分享内容整理的文字。http://openre...原创 2019-03-13 23:40:45 · 689 阅读 · 0 评论 -
Linux 常用命令
shell移动光标Ctrl – a :移到行首Ctrl – e :移到行尾User and Loginuseradduseradd usernameid usernametail -10 /etc/passwdtail -10 /etc/grouptail -10 /etc/shadowpasswdpasswd usernameFile Systemls...原创 2019-07-04 09:46:58 · 299 阅读 · 0 评论 -
初识grep 命令
创建文件 samplefile 内容如下this is aboveof2 this is aboveof1abcthis is below1 this is below2 this is aboveof2this is aboveof1abc123abc...原创 2019-09-22 19:39:42 · 134 阅读 · 0 评论