进程及服务的控制
1.什么是进程zzz
进程是计算机中的程序关于某数据集合上的一次运行活动,是系统进行资源分配和调度的基本单位,是操作系统结构的基础
2.图形的进程查看方法
gnome-system-monitor
proc 文件返回数据
3.查看进程的命令
whatis ps
man ps看常用的参数 查看相关的进程
a 当前环境相关的进程
-a 在当前终端运行的进程呢个,但不包含当前环境进程信息
-A|-e 系统当前所有的进程
x 查看还有字符终端的信息,包含必须有字符设备
f 查看进程呢个的从属关系
u 进程的所有人
ps ax -o comm,nice,%cpu,%men,pid,group,stat 查看进程的信息
ps ax --sort=%cpu 排序
ps ax --sort=-%cpu 倒叙
4.进程优先级
最高优先级veryhigh 20
最低优先级verlow 0
S 进程状态
s 此经成为顶级进程
T 任意进程是暂停的
< 近臣的优先级高
N 进程优先级低
Sl 进程在内存中有所定的空间的
renice -n -5 pid 修改i进程的优先级
nice -n -5 命令 & 指定优先及开启进程
ps -o nice,comm,pid 查看优先及进程
5.进程前后台的调用
jobs 查看被打入后台的程序
bg jobsnum(1..2) 将指定进程在后台运行
fg jobsnum(1..2)将指定进程调回前台
ctrl+z 将占用终端的进程打入后台停止
ctrl+c 将占用当前终端的进程结束
6.信号
1 进程不停止强况下重新加载配置
2 清除进程呢个在内存之嗯的数据
3 清楚鼠标在内存中的数据
9 强行结束进程,不能被阻塞
15 正常关闭进程
18 运行停止的进程
19 暂停进程,不能被组阻塞
20 暂停进程,
xml 可扩展标记语言,,,,,,语法非常严谨
数据库封装的
index.thml阿帕奇首先展示的是这个网站
kill 信号 pid
killall 信号 进程名称
ifconfig eth0: 展示虚拟机的信息
真机控制控制虚拟机:命令 :ssh rot@虚拟机的ip
systrmctl status sshd.service 让别人可以连接
systrmctl status sshd.service 让别人可以连接
ip addr show br0 看自己的ip
c client s sercer 模型
主机是c 虚拟器 s
7.服务的控管
systemctl start sshd 开启
systemctl stop sshd 关闭
systemctl status sshd 显示状态
systemctl restart sshd 重启
systemctl enable sshd 让开机的时候自己启动
systemctl disable sshd 开机不打开
systemctl list-units 所有开着的正在运行的服务名称
systemctl list-units-first sshd 服务开机状态
systemctl list-units-dependncies sshd 列出服务依赖关系
systemctl mask sshd 冻结服务
systemctl unmask sshd 界所服务
systemctl set-default graphcal.target 图形启动
systemctl set-default muti-user.target无图启动
1关机
5有图形
6重启
last 谁登陆过我
lastb 企图登陆我没有成功
w 正在使用我
w -f
w -i 显示
ps aux|grep pts/1 显示谁连你的、
/var/log/btmp清除登陆记录
ssh -X root@连接