1.建立虛擬機連接Xshell,并建立在/opt文件下/tmp

屏幕截圖 2026-01-11 170626.png
- 在/tmp文件下建立a.txt
[root@server tmp]# touch a.txt
- 打開vim文本編輯器
[root@server tmp]# vim /tmp/newfile
i進入編輯模式 輸入2026-01-11
在命令模式下
:2r /boot/grub2/grub.cfg
:g/#/d
:set number
:wq

屏幕截圖 2026-01-11 170435.png