【Linux】一些常用命令(待整理)

一、关机重启命令

shutdown -h 10       #计算机将于10分钟后关闭,且会显示在登录用户的当前屏幕中
shutdown -h now      #计算机会立刻关机
shutdown -h 22:22    #计算机会在这个时刻关机
shutdown -r now      #计算机会立刻重启
shutdown -r +10      #计算机会将于10分钟后重启
reboot               #重启
halt                 #关机

二、查询ip

CentOs7

ip addr

三、查询杀死进程

ps -ef|grep
kill -9 <process_id>

四、CentOS7 关闭防火墙

//临时关闭
systemctl stop firewalld
//禁止开机启动
systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

五、vim常用

5.1 搜索

/关键字
小写n 向下搜索
大写N 向上搜索
关闭高亮:命令模式下,输入:nohlsearch  也可以:set nohlsearch; 当然,可以简写,noh或者set noh

5.2 设置行号

:set number

剪切

d

替换

#将9001替换为9002
:%s/9001/9002

猜你喜欢

转载自www.cnblogs.com/haoworld/p/linux-yi-xie-chang-yong-ming-ling-dai-zheng-li.html