一、设置主机名称
1、文件的方式
二、网络管理命令
查看网卡
[root@test ~]# nmcli connection show
NAME UUID TYPE DEVICE
ethe 941638f6-4943-4bc5-878d-a5e0aa44aa93 ethernet eth0
eth1 f492df40-4db6-404e-a014-6c5a2763bb9b ethernet eth1
lo 5dc67977-a6d3-4b73-bb1c-6fc2890046e4 loopback lo
有线连接 1 a7cdeab8-d42a-4ca1-903d-2564e3a578e3 ethernet --
ens160 768fd22e-8832-35c9-973f-e0f080078552 ethernet --
[root@test ~]# nmcli device show eth1
GENERAL.DEVICE: eth1
GENERAL.TYPE: ethernet
GENERAL.HWADDR: 00:0C:29:8C:4F:E7
GENERAL.MTU: 1500
GENERAL.STATE: 100(已连接)
GENERAL.CONNECTION: eth1
GENERAL.CON-PATH: /org/freedesktop/NetworkManager/ActiveC>
WIRED-PROPERTIES.CARRIER: 开
[root@test ~]# nmcli device status
DEVICE TYPE STATE CONNECTION
eth0 ethernet 已连接 ethe
eth1 ethernet 已连接 eth1
lo loopback 连接(外部) lo
[root@test ~]# ip a s eth1
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:0c:29:8c:4f:e7 brd ff:ff:ff:ff:ff:ff
altname enp19s0
altname ens224
inet 192.168.0.100/24 brd 192.168.0.255 scope global noprefixroute eth1
valid_lft forever preferred_lft forever
inet6 fe80::91de:8c69:8af8:9c40/64 scope link noprefixroute
valid_lft forever preferred_lft forever
设置网卡
[root@test ~]# nmcli connection add con-name eth1
[root@test ~]# nmcli connection modify eth1 ipv4.addresses 172.25.254.100/24
[root@test ~]# nmcli connection reload
[root@test ~]# nmcli connection up eth1
连接已成功激活(D-Bus 活动路径:/org/freedesktop/NetworkManager/ActiveConnection/4)
三、打印字符
1、打印连续字符
[root@test ~]# seq 1 3
1
2
3
[root@test ~]# seq -f "%03g" 1 3
001
002
003
[root@test ~]# seq 1 2 10
1
3
5
7
9
[root@test ~]#
2、反向打印文件内容
[root@test ~]# seq 1 9 >test
[root@test ~]# tac test
9
8
7
6
5
4
3
2
1
3、打印字符
root@test ~]# printf "hello world"
hello world[root@test ~]# printf "hello world\d"
hello world\d[root@test ~]# printf "hello\world\n"
hello\world
[root@test ~]# printf "3%%\n"
3%
[root@test ~]# printf "%.1f" "3.141526"
3.1[root@test ~]# printf "%.1f \n" "3.141526"
3.1
[root@test ~]# echo "hello word"
hello word
[root@test ~]# echo -n "hello word"
hello word[root@test ~]#