linux常用命令

查看进程数量

ps aux | grep httpd | wc -l

 查看yum安装

yum list installed | grep php

& 将指令丢到后台中去执行
[ctrl]+z 將前台任务丟到后台中暂停
jobs 查看后台的工作状态
fg %jobnumber 将后台的任务拿到前台来处理
bg %jobnumber 将任务放到后台中去处理
kill 管理后台的任务

后台运行

$ ./test.sh &

 查找名为“httpd.conf”的文件,并把所有标准输出和错误输出重定向到find.dt的文件中: 

find /etc/httpd/ -name "httpd.conf" -print >find.dt 2>&1 & 

 退出shell的时候继续运行进程

$ nohup ./loop.py >loop.dt 2>&1 &

 yum安装ntp

yum install ntp

 yum搜索vim

yum search vim

 yum升级源

yum update

 timzone

cp /usr/share/zoneinfo/Asia/Shanghai   /etc/localtime

 ntpdate同步时间

ntpdate 0.uk.pool.ntp.org

 ntp配置

# vi /etc/ntp.conf
server 0.uk.pool.ntp.org
server 1.uk.pool.ntp.org
driftfile /var/lib/ntp/ntp.drift 

 开机启动

# /etc/init.d/ntpd start
# chkconfig --level 35 ntpd on 

 将一个已有用户 www 增加到一个已有用户组 apache 中

usermod -a -G apache cnzhx

 查设备型号

dmidecode | grep "Product"
原文地址:https://www.cnblogs.com/fenle/p/4465451.html