hello, to tell you the last directory management, file management, date, time management
If some forgotten, then you can watch https://www.cnblogs.com/X404/p/12235929.html
First summarize ~~
Catalog Management: mkdir rmdir ls cd pwd tree
Document Management: touch nano stat cp mv rm file
Time Management: date clock cal hwclock
------------------------------------------------------------
Today, we introduce is related to file management commands ~
View files cat more less head tail
CAT [] and display a file
cat /etc/issue
cat /etc/fstab
If both be in the same line if the commands it?
Other parameters cat how to use it?
cat -n display line numbers
cat -T display tabs
cat -E display terminator
cat -v display non-printing characters
cat -A display all characters
tac: never displayed to the header portion (cat from the head portion to the tail portion is displayed, tac and vice versa)
Split-screen display: more less
more [] support turned back, but when the turn to the bottom exits
less [] support before and after the turn, press q to exit
head: to see the word on the thought of the head, it represents the first N rows view
Head -n e.g.
tail: It represents the view N lines
For example: tail -n
tail -f any other process is executed, the display immediately, without waiting to exit the display reads this file new content
Text Processing cut
cut []
cut -d: performing the specified delimiter
cut -f: performing the specified field of N
E.g:
cut -d -f 1,3
1-3 shows the execution field delimiter
Text sort sort
Sort [] Effect display data storage does not affect
sort -n numeric sort
sort -r reverse order
sort -t field delimiter
sort -k keyword to the field is not sorted
After ordering the same sort-u display line only once
sort -f 排序时忽略相同是字符大小
uniq 【】相邻重复的行
uniq -d 只显示重复行
uniq -D 只显示重复行N行N个
uniq -c 显示某个重复次数
文本统计 WC
分别是 行,单词,字节
WC []
-c 字节数
-l 行数
-w单词数
-L 最长的一行包含多少字符
字符处理命令:tr转换或删除字符
tr 'ab' 'AB' 转换
tr -d ‘ab’删除字符中出现ab的所有字符