IT袋

当前位置:主页 > 经验教程 > 系统教程 >

Linux常用命令

Linux常用命令 常见的Linux命令(4)

时间:2024-01-25 12:09:40 来源:IT袋 作者:马勇
导读:Linux常用命令,kill 18828  # 杀死pid为18828的服务 killall用来终止某个指定名称的服务所对应的全部进程,参数为进程名称 pidof httpd # 查询httpd服务的全部进程killall httpd

Linux常用命令

kill 18828  # 杀死pid为18828的服务

killall用来终止某个指定名称的服务所对应的全部进程,参数为进程名称

pidof httpd  #  查询httpd服务的全部进程
killall httpd   # 终止http服务的全部进程

命令15:ifconfig

ifconfig命令主要是用来获取网卡配置和系统的网络状态等信息,主要信息为:

  • 网卡名称
  • inet参数后面的IP地址
  • MAC地址
  • RX、TX的接收和发送数据等信息
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.8.2  netmask 255.255.252.0  broadcast 10.0.11.255
        inet6 fe80::5054:ff:fe95:2cdf  prefixlen 64  scopeid 0x20<link>
        ether 52:54:00:95:2c:df  txqueuelen 1000  (Ethernet)
        RX packets 48350308  bytes 13922587280 (12.9 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 50364002  bytes 30975667765 (28.8 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

命令16:history

history命令主要是用来查看我们敲过的历史命令。

history  # 查看全部历史命令
history 10  # 查看最近的10条命令

history可以与grep、tail配合使用进行条件过滤来查找我们需要的命令:

history | grep dnf  # 和dnf相关的命令
history | tail -n 3   # 末尾3条命令

清除历史命令:

history  -d 50  # 清除第100条
history -c  # 全部清除掉

上述的关于Linux常用命令的具体介绍,希望大家能喜欢!

相关阅读