随笔分类 - Linux
摘要:不管是重启系统还是关闭系统,首先要运行 sync 命令,把内存中的数据写到磁盘中。将数据由内存同步写入到硬盘中。 [root@localhost ~]# sync 一、shutdown命令 # 立刻关机,now相当于时间为0 [root@localhost ~]# shutdown -h now #
阅读全文
摘要:Linux系统有7个运行级别(runlevel) 1、级别有0-6共7个级别,其中2345是默认启动级别。 2、查看运行级别(centos6与centos7) [root@localhost ~]# runlevel 3、切换运行级别(centos6与centos7)。 [root@localhos
阅读全文
摘要:一、安装iptables服务 1、查看系统是否安装了iptables防火墙 [root@localhost ~]# iptables -V 2、安装 iptables 防火墙 3、查看防火墙规则列表 [root@localhost ~]# iptables --list [root@localhos
阅读全文
摘要:一、安装ufw服务 ubuntu@VM-0-16-ubuntu:~$ sudo apt-get install ufw 二、开启、关闭、重启ufw服务 1、开启 ufw 防火墙 ubuntu@VM-0-16-ubuntu:~$ sudo ufw enable # 开启了防火墙,并在系统启动时自动开启
阅读全文
摘要:一、安装firewalld服务 [root@localhost ~]# apt-get install firewalld [root@localhost ~]# yum install firewalld 二、开启、关闭、重启firewalld服务 # 关闭firewalld服务 [root@lo
阅读全文
摘要:一、通过SecureCRT的rz、sz实现文件的上传和下载 1.检查是否安装sz rz,命令如下 2.安装lrzsz软件,命令如下 3.文件上传 4.文件下载 二、通过sftp实现文件的上传和下载 为了数据和服务的安全, 很多生产环境中的Linux服务器不能使用外网环境. 在只有SSH连接的情况下,
阅读全文
摘要:系统启动时需要加载的配置文件 /etc/profile、/root/.bash_profile/etc/bashrc、/root/.bashrc/etc/profile.d/*.sh、/etc/profile.d/lang.sh/etc/sysconfig/i18n、/etc/rc.local(/e
阅读全文
摘要:环境变量文件的分类 系统级环境变量:每一个登录到系统的用户都能够读取到系统级的环境变量。 用户级环境变量:每一个登录到系统的用户只能够读取属于自己的用户级的环境变量。 一、系统级环境变量文件 Centos 中:/etc/environment、 /etc/profile、 /etc/profile.
阅读全文
摘要:CentOS 镜像源的修改(yum镜像源) https://www.cnblogs.com/Tsubasa0769/p/10728161.html Ubuntu 镜像源的修改(apt-get镜像源) 1、备份一下 Ubuntu 原来的源地址列表文件。 ubuntu@VM-0-16-ubuntu:~$
阅读全文
摘要:一、/etc/profile文件详解(环境变量) 添加环境变量 二、/etc/sysctl.conf文件设置(修改Linux内核参数:包括TCP/IP堆栈和虚拟内存系统的高级选项) https://www.cnblogs.com/ginvip/p/6351740.html https://blog.
阅读全文
摘要:一、chkconfig 介绍 二、service 介绍 1、常见 service 命令 [root@localhost ~]# service supervisord stop [root@localhost ~]# service supervisord start [root@localhost
阅读全文
摘要:创建挂载目录 [root@localhost ~]# mkdir -p /www 可以看到/dev/vda1盘挂载/ /dev都是位于根路径下,都属于系统盘。根路径 / 都是位于系统盘。而/root,/home,/usr就如同c盘下的c:\windows,c:\usr这些目录。如果单独有数据盘,且数
阅读全文

浙公网安备 33010602011771号