Linux常用命令: 文件處理

放心~被指到的人一定能學(xué)會(huì)的~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~?
vim
VIM是一個(gè)命令行文本編輯器,為不同的文件操作提供了多種操作模式
通過i可以進(jìn)入編輯模式.?Esc可以返回命令模式(無法輸入指令控制)
sed
直接通過腳本修改文件內(nèi)容
wc
統(tǒng)計(jì)行/單詞/字節(jié)
ln
給文件和目錄創(chuàng)建連接
chmod
修改文件和目錄的訪問權(quán)限
?
?
1. vim
Vim (Vi IMproved), a command-line text editor, provides several modes for different kinds of text manipulation.
VIM是一個(gè)命令行文本編輯器,為不同的文件操作提供了多種操作模式
Pressing?i?enters edit mode.?<Esc>?goes back to normal mode, which doesn't allow regular text insertion.
通過i可以進(jìn)入編輯模式.?Esc可以返回命令模式(無法輸入指令控制)
??Open a file(打開文件):
??View Vim's help manual(查看幫助手冊(cè)):
??Save a file(保存文件, 簡寫:w?):
??Quit without saving(退出不保存, 簡寫?:q!):
??Save and quit (保存退出):
??Open a file at a specified line number(在某行打開文件):
??Undo the last operation(撤銷最近操作):
??Search for a pattern in the file (press?n/N?to go to next/previous match)(文件搜索, 通n/N切換向后向前匹配):
??Perform a regex substitution in the whole file(替換內(nèi)容,支持正則):
2. sed
Edit text in a scriptable manner.
直接通過腳本修改文件內(nèi)容
??Replace the first occurrence of a regular expression in each line of a file, and print the result(打印并且替換文件中每行第一次出現(xiàn)的指定內(nèi)容,支持正則):
??Replace all occurrences of an extended regular expression in a file, and print the result(打印并且替換文件中出現(xiàn)的指定內(nèi)容,支持?jǐn)U展正則):
??Replace all occurrences of a string in a file, overwriting the file (i.e. in-place)(替換文件中所有匹配的內(nèi)容并寫入文件):
??Replace only on lines matching the line pattern(匹配行之后再進(jìn)行替換文件中的內(nèi)容):
??Delete lines matching the line pattern(刪除匹配行內(nèi)容):
??Print only text between n-th line till the next empty line(從第n行打印內(nèi)容到下一個(gè)空行):
??Apply multiple find-replace expressions to a file(多匹配替換操作):
3. wc
Count lines, words, or bytes.
統(tǒng)計(jì)行/單詞/字節(jié)
??Count lines in file(統(tǒng)計(jì)行數(shù)):
??Count words in file(統(tǒng)計(jì)單詞數(shù)):
??Count characters in file (taking multi-byte character sets into account)(可以統(tǒng)計(jì)中文字?jǐn)?shù)等多字節(jié)字符):
4. ln
Creates links to files and directories.
給文件和目錄創(chuàng)建連接
??Create a symbolic link to a file or directory(為文件目錄創(chuàng)建軟連接,路徑絕對(duì)):
??Create a hard link to a file(創(chuàng)建硬鏈接):
5. chmod
Change the access permissions of a file or directory.
修改文件和目錄的訪問權(quán)限
??Give the [u]ser who owns a file the right to e[x]ecute it(給擁有者添加執(zhí)行權(quán)限):
??Remove e[x]ecutable rights from the [g]roup(移出所屬組的執(zhí)行權(quán)限):
??Give [a]ll users rights to [r]ead and e[x]ecute(給所有用戶添加讀和執(zhí)行權(quán)限):
??Give [o]thers (not in the file owner's group) the same rights as the [g]roup(將其他人設(shè)置為同所屬組):
??Remove all rights from [o]thers(移出其他人的所有權(quán)限):
??Change permissions recursively giving [g]roup and [o]thers the abililty to [w]rite(給目錄中所有文件和目錄的所屬組和其他人設(shè)置可讀權(quán)限):
?

自學(xué)筆記~
如果有錯(cuò)~
期待大佬指出~
感謝幫助提升~?