作業(yè)要求:

image.png
history查詢全部命令如下:
[root@192 tmp]# history
6 cd /opt
7 mkdir tmp
8 ls
9 cd /tmp
10 touch a.txt
11 ls
15 cd tmp/
17 cd /opt
18 cd tmp/
19 ls
20 touch a.txt
21 ls
22 tree opt
23 tree /opt
24 vi newfile
25 cd /boot/grub2/
26 ls
27 cat /boot/grub2/grub.cfg > /opt/tmp/newfile
28 cat /opt/tmp/newfile
29 cd /opt/tmp/
30 ls
31 vim newfile
32 history
完成詳細步驟
1:
創(chuàng)建安裝步驟省略
2文件管理命令:
[root@192 ~]# cd /opt
[root@192 opt]# mkdir tmp
[root@192 opt]# ls
tmp
[root@192 opt]# cd tmp/
[root@192 tmp]# touch a.txt
[root@192 tmp]# ls
a.txt
[root@192 tmp]# tree /opt
/opt
└── tmp
└── a.txt
1 directory, 1 file
3vi/vim練習:
[root@192 tmp]# vi newfile
然后在文件中按i進入編輯輸入時間,輸入完畢后按esc,再按shfit+:,輸入wq,保存退出。
[root@192 tmp]# cd /boot/grub2/
[root@192 grub2]# ls
fonts grub.cfg grubenv
[root@192 grub2]# cat /boot/grub2/grub.cfg > /opt/tmp/newfile
[root@192 grub2]# cd /opt/tmp/
[root@192 tmp]# ls
a.txt newfile
[root@192 tmp]# vim newfile
進入文件后在有#的字符的行列雙擊d鍵進行整行刪除,然后esc,shfit+:輸入set nu開啟vi行號提示功能,再輸入wq保存退出。
總結
第一次作業(yè)到這里就寫完了,總體比較的基礎,都是非常簡單的操作,重點還是對基礎命令的掌握。