Linux 系统管理常用命令

一、用户切换

su 用户切换

 

二、进程观察命令

ps 显示进程

ps -v 显示虚拟内存相关

ps -a 显示所有用户进程

ps -e 显示所有进程,忽略所有者

ps -f 显示所有相关信息

ps -u test48 显示test48用户进程

ps -G grp1 显示grp1组进程

 

常用命令为ps -ef

 

 

三、进程相关命令

renice +1 9911 对9911进程降低优先级,可取-20到+19,默认为0,-20优先级最高

 

renice -1 9911 提升9911进程优先级

 

kill 9911 结束进程9911

KILL 9911 强制结束进程9911

 

 

四、启动方式

/etc/inittab文件中包含系统默认启动到哪个等级,共有0-6个等级

0 halt

1 single user mode

2 multiuser,without NFS

3 full multiuser mode

4 unused

5 X11

6 reboot

 

五、服务列表

chkconfig --list 显示所有当前服务状态

 

chkconfig --list | grep httpd

chkconfig --list | grep sendmail

chkconfig --list | grep nfs

chkconfig --list | grep named

chkconfig --list | grep smb

chkconfig --list | grep sshd

chkconfig --list | grep telnet

chkconfig --list | grep Wuftpd

chkconfig --list | grep ftp

 

chkconfig telnet on | off

chkconfig httpd on | off

 

service httpd strat | stop

 

 

六、关闭系统

shutdown -h 关闭系统halt

shutdown -r 重启

shutdown -r now 立即重启

shutdonw -r 23:30

shutdown -r +15

shutdonw -r +30

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值