菜鸟学Linux 第007篇笔记 简单命令的使用讲解(文本、时间、目录)
Linux 發行版
Fedora, RedHat(CentOS), SUSU, Debian(Ubuntu, Mint), Gentoo, LFS(Linux From Scratch)
Command
目錄管理(先前節數已經講)
ls、cd、pwd、mkdir、rmdir、tree
文件管理(先前節數已經講)
touch、stat、file、rm、cp、nano、mv
日期時間(先前節數已經講)
date、clock、hwclock、cal
查看文本
cat、tac、more、less、head、tail
文本處理
cut、join(用得不多)、sed、awk
文本排序
sort、uniq
文本統計
wc
字符處理
tr
detail of Command
查看文本
cat concatenate(V.連接) files and print on the standard output
-n number all output lines
-A --show-all
-E display $ at end of each line 行結束符
tac concatenate and print files in reverse(反轉)
more? file perusal filter for crt viewing(和less區別到end會退出而less不會)
less opposite of more
head? output the first part of files
tail output the last part of files
-f ? output appended data as the file grows; -f, --follow, and --fol-
??low=descriptor are equivalent 查看文件尾部,等待顯示后續追加內容
head/tail -n output the first/last N lines
文本處理
cut? remove sections from each line of files
-d? use DELIM instead of TAB for field delimiter(定界符)
-f? select only these fields;
文本排序
sort? sort lines of text files
-n? compare according to string numerical value
-r? reverse the result of comparisons(比較)
-t? use SEP instead of non-blank to blank transition(字段分隔符)
-k start a key at POS1, end it at POS2 (origin 1)(從哪里開始排序)
-u 去除重復 with ?-c, ?check ?for ?strict ordering; without -c, output
??only the first of an equal run
-f fold lower case to upper case characters(折疊大小寫 按字翻譯哈哈)
uniq report or omit repeated lines(顯示相鄰重復的行)
-d only print duplicate(重復) lines
-c prefix(前綴) lines by the number of occurrences 顯示重復行次數
文本統計
wc print the number of newlines, words, and bytes in files
-c print the byte counts
-l print the newline counts
-w print the word counts
-L print the length of the longest line
字符處理
tr translate or delete characters
用法示例: tr 'a-z' 'A-z' < /etc/passwd ? 將此文件里的小字轉換為大寫 <此符號以后會講
-d delete characters in SET1, do not translate
Ctrl+c 中斷當前程序
Shift+Page up/down 在終端里翻頁(有限會有一部分被刪除)
本文轉自Winthcloud博客51CTO博客,原文鏈接http://blog.51cto.com/winthcloud/1856977如需轉載請自行聯系原作者
Winthcloud
總結
以上是生活随笔為你收集整理的菜鸟学Linux 第007篇笔记 简单命令的使用讲解(文本、时间、目录)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Ubuntu12.04安装中文字体,解决
- 下一篇: Linux-0.00运行环境搭建【转】