TEST
[root@localhost Desktop]# touch WESTOS_class{1..2}_linux{1..6} redhat_version{1..8} [root@localhost Desktop]# mkdir study /tmp/VERSION SINGLE /DOUBLE CLASS1 CLASS2 confdir
[root@localhost Desktop]# mv WESTOS_class{1..2}_linux{1..6} study
[root@localhost Desktop]# mv redhat_version{1..8} /tmp/VERSION
[root@localhost Desktop]# CP /tmp/VERSION/redhat_version{1,3,5,7} SINGLE
[root@localhost Desktop]# CP /tmp/VERSION/redhat_version{2,4,6,8} /DOUBLE
[root@localhost Desktop]# mv study/WESTOS_class[1]_linux{1..6} CLASS1
[root@localhost Desktop]# mv study/WESTOS_class[2]_linux{1..6} CLASS2
[root@localhost Desktop]# cp /etc/*[[:alpha:][:digit:]]*.conf confdir
[root@localhost Desktop]# rm -fr *
解釋
1.檔案建立touch file
2.目錄建立mkdir testmkdir -p dir1/dir2/dir3-p建立遞回目錄時,當上層目錄不存在自動建立
3.檔案洗掉 rm file
rm -fr file 強制洗掉file里面的所有檔案
rm -fr * 洗掉所有
4.編輯檔案
(1)gedit gedit file 必須有圖形
(2)vim 編輯檔案 vim file -->按[i]進入insert模式-->書寫內容-->按[esc]退出insert模式-->:wq退出保存vim例外當vim例外退出時會生成.file.swp檔案[O]pen Read-Only, 只讀打開(E)dit anyway, 繼續編輯(R)ecover, 恢復(D)elete it,洗掉 (Q)uit, 退出(A)bort: 退出
想vim恢復正常作業,則洗掉.swap檔案,選D
5.cat file ##查看檔案的全部內容
cat -b file ##-b顯示行號不包含空行
cat -n file ##-n顯示行號包含空行
6.tail file ##查看檔案后10行
7.head file ##查看檔案前10行
8.less file ##分頁瀏覽
9.mv file file1 ##將前面內容移動到后面檔案,相當于重命名.
10.mv file dir ##將檔案移動到目錄里面
mv dir/* . ##把dir中的所以檔案移動到當前桌面11.cp file file1 ##將前面檔案的內容復制到后面的檔案中
12.cp file file1 dir ##將兩個檔案復制到目錄里面
13.cp -r dir dir1 ##將dir目錄下的所有檔案都復制到dir1中
14.
wc 統計檔案大小
wc -l ##行數
wc -w ##單詞數
wc -m ##字符數
wc -c ##位元組數
轉載請註明出處,本文鏈接:https://www.uj5u.com/caozuo/117542.html
標籤:非技術區
上一篇:第一,二章運維基本命令作業
下一篇:請問這個題目哪里有問題()
