Ubuntu文件操作隨記
-
創(chuàng)建文件
touch test.txt
-
編輯文件
vi test.txt
- 顯示編輯窗口按“i”進(jìn)行插入
- 編輯完按“ESC”鍵,輸入“:”悠抹,再輸入“wq”保存
-
cat test.txt
查看文件內(nèi)容 -
ls
或find test.txt
查看文件是否存在
-
查看文件屬性
-
wc
默認(rèn)顯示(行數(shù)防症,單詞數(shù)孟辑,字節(jié)數(shù)) -
wc -c
只顯示字節(jié)數(shù) -
wc -l
只顯示行數(shù) -
wc -L
顯示最長行數(shù) -
ll | wc -l
顯示的是總文件數(shù)包含./ .// 目錄
-