打印配置文件nginx.conf内容的行号及内容和开机启动软件设置和查看配置文件总行数
2017-09-02 16:10
776 查看
打印配置文件
1.nl nginx.conf
2.cat -n nginx.conf <=======这个最常用
3.less -N nginx.conf
4.vi 文件 然后执行:set nu, :set nonu 为取消行号
5.grep -n ./etc/services
开机启动软件设置(设置sshd开机不启动)
第一种方式:
1. chkconfig --list sshd
2. chkconfig --level 245 sshd off
3.操作完执行chkconfig --list sshd 再次查看结果
第二种方式:
1.添加注释
echo "#sshd start by wj at 201709" >> /etc/rc.local 先添加注释
2.echo "/etc/init.d/sshd start" >>/etc/rc.local 将sshd服务启动命令加入到/etc/rc.local文件中,切记使用>>追加不是>
sed -i '/$/d' /etc/rc.local清除最后一行内容
查看文件行数
wc -l /etc/services 查出文件总行数
cat -n /etc/services|tail -1
sed -n '$=' /etc/services
awk '{print NR}' /etc/services|tail -1
grep
1.nl nginx.conf
2.cat -n nginx.conf <=======这个最常用
3.less -N nginx.conf
4.vi 文件 然后执行:set nu, :set nonu 为取消行号
5.grep -n ./etc/services
开机启动软件设置(设置sshd开机不启动)
第一种方式:
1. chkconfig --list sshd
2. chkconfig --level 245 sshd off
3.操作完执行chkconfig --list sshd 再次查看结果
第二种方式:
1.添加注释
echo "#sshd start by wj at 201709" >> /etc/rc.local 先添加注释
2.echo "/etc/init.d/sshd start" >>/etc/rc.local 将sshd服务启动命令加入到/etc/rc.local文件中,切记使用>>追加不是>
sed -i '/$/d' /etc/rc.local清除最后一行内容
查看文件行数
wc -l /etc/services 查出文件总行数
cat -n /etc/services|tail -1
sed -n '$=' /etc/services
awk '{print NR}' /etc/services|tail -1
grep
相关文章推荐
- nginx查看配置文件是否正确 查看nginx.conf路径
- Ngin的配置文件nginx.conf完整配置说明(包括fastcgi和负载均衡设置)
- nginx查看配置文件nginx.conf路径
- nl 查看文件内容(添加行号打印)
- Mac 通过 Homebrew 安装 nginx 并设置开机启动配置
- centos7 配置nginx服务、设置开机自动启动
- Nginx配置配置文件nginx.conf的设置
- Windows下Nginx的启动、停止等命令&Nginx 配置多域名&windows下设置Nginx开机自动启动
- nginx 从vagant挂载目录中加载nginx.conf配置进行开机启动
- nginx.conf配置文件中timeout超时时间设置
- nginx配置文件nginx.conf配置内容和中文详解(内容整理)
- pythond进程管理软件 supervisor 3.3.3 配置文件以及开机启动
- nginx查看配置文件nginx.conf路径
- gridcontrol显示行号,总行,打印,导出Excel,设置标头及内容居中方法
- Nginx配置配置文件nginx.conf的设置
- Nginx 配置文件nginx.conf的完整配置说明
- ubuntu下设置开机启动 sysv-rc-conf
- NGINX:nginx.conf配置文件
- Vim的行号、语法显示等设置(.vimrc文件的配置)以及乱码解决
- 转:Ubuntu的启动配置文件grub.cfg(menu.lst)设置指南