一、查看 TCP 22 端口是否打开 1、列出所有端口: [root@Demon proc]# netstat -ntlp Active Internet connections (only servers) Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1634/r
12. 查看系统硬件配置 1、内存:内存的信息 主要在 /proc/meminfo 文件中 (free 命令可以查看内存的基本信息) # 所有可用 RAM 的大小 MemTotal: 1907580 kB # LowFree 和 HighFree 的总和 MemFree: 234816 kB # 缓存大小 Buffers: 54020 kB # 被高速缓存器使
一、分别制造 CPU、内存、磁盘IO、网络IO繁忙的情况,并用 top, dstat, iostat 等工具观察 1、top a、命令解析 - q 退出top命令 - 立即刷新 - s 设置刷新时间间隔 - c 显示命令完全模式 - t 显示或隐藏进程和CPU状态信息 - m 显示或隐藏内存状态信息 - l 显
一、编译 nginx ,并安装 1、安装依赖的软件包: [root@Demon D]# yum -y install openssl-devel [root@Demon D]# yum -y install pcre-devel 2、安装 nginx : [root@Demon D]# yum -y install nginx 默认安装的位置在 /etc/nginx/nginx.conf 二、架设一个
一、只给 Centos 6.5 打开 22 和 80 端口,并且重启后有效: 1、查看所有 iptables 配置: [root@Demon yum.repos.d]# iptables -L -n (当前防火墙是关闭的) Chain INPUT (policy ACCEPT) target prot opt source destination Chain FORWARD (policy ACCEPT)
一、给 yum 加入 epel 源 1、先安装一个软件包 epel-release,它会自动配置 yum 的软件仓库 # rpm -Uvh//thunder.mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm # rpm -Uvh //rpms.famillecollet.com/enterprise/remi-re
一、Shell 脚本编写 1、提示用户输入一个字符串,如果是 hello,打出 yes,并每秒输出 hello,world,否则就输出 no,实现如下: #!/bin/bash #Filename:hello.sh echo Please input hello read -p str // 得到键盘输入 echo $str if [ $str == hello ] then
一、进程状态 1、查看 watchdog 该进程是否存在,并得到该进程的 ID 父进程 ID [root@Demon home]# ps -ef | grep watchdog root 6 2 0 06:44 ? 00:00:00 [watchdog/0] root 8698 3113 0 14:53 pts/0 00:00:00 grep watchdog watchdog 的进程 ID = 6,父进程
一、使用 tar 进行压缩和解压缩 tar 命令解析: -c 压缩目录 -z 使用 gzip 命令处理备份文件 -Z 使用 compress 命令处理备份文件 -j 使用 bzip2 命令处理备份文件 -x 解压 压缩包 -v 显示命令的执行过程 -f 指定备份的文件 -t 列出压缩包里面文件的目录 -C
/home 用户主目录的根节点,所有用户自己独有的文件一般放在这个目录下的用户目录下 /bin 二进制可执行命令 /tmp 存放临时文件 /usr 应用程序默认安装路径,一般的大文件都是放在这里,包括内核源代码,需要的空间是大的 /lib 存放一些库文件 /sys sysfs