巧学巧用快捷命令
1、!$ 上一条命令的最后一条参数,不用重复输入长参数
例如:
[[email protected]~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 HWADDR=00:0C:29:AA:77:84 TYPE=Ethernet UUID=7260d0db-35da-43f2-a0bd-c2d4edc24db2 ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=none IPADDR=192.168.20.10 NETMASK=255.255.255.0 GATEWAY=192.168.20.1 DNS1=192.168.1.17 [[email protected] ~]#vi !$ !$ 等于/etc/sysconfig/network-scripts/ifcfg-eth0 vi /etc/sysconfig/network-scripts/ifcfg-eth0
2、!文件名 或 !命令 执行最近一条以文件名或命令开头的命令,不用重复输入长命令或长参数;
#! /etc/ 运行最近一条以/etc/开头的命令
#!cat 运行最近一条以cat开头的命令,中间没有空格;
例如:
[[email protected]~]# cat /etc/resolv.conf ; generated by /sbin/dhclient-script nameserver 192.168.1.1 nameserver 192.168.1.1 [[email protected]~]#!cat cat /etc/resolv.conf ; generated by /sbin/dhclient-script nameserver 192.168.1.1 nameserver 192.168.1.1
时间: 2025-01-20 06:09:24