Home | Mirror | Search

Netkiller Linux Shell 手札

Mr. Neo Chan, 陳景峰(BG7NYT)


中國廣東省深圳市龍華新區民之街道溪山美地
518109
+86 13113668890
+86 755 29812080

2009-11-15

版權聲明

轉載請與作者聯繫,轉載時請務必標明文章原始出處和作者信息及本聲明。

文檔出處:
http://netkiller.sourceforge.net
http://netkiller.github.com


您可以使用iBook閲讀當前文檔

目錄

自述
1. 系列文檔
2. 作者簡介
3. 寫給讀者
I. Shell
1. Introduction
1. chsh - change login shell
2. test 命令
3. I/O 重定向
3.1. error 重定向
3.2. 使用塊記錄日誌
3.3. tee - read from standard input and write to standard output and files
3.3.1. nettee - a network "tee" program
3.4. 快速清空一個檔案的內容
4. pipes (FIFOs)
5. mktemp - create a temporary file or directory 臨時目錄與檔案
6. History 命令歷史記錄
6.1. .bash_history
6.2. .mysql_history
2. Bash Shell
1. bash - GNU Bourne-Again SHell
1.1. -n 檢查腳本是否有語法錯誤
1.2. -x 顯示詳細運行過程
2. prompt
3. Internal Environment Variables
4. variable
4.1. set
4.2. export / unset
4.3. declare
4.4. 系統變數
4.5. Strings
4.5.1. ##/#
4.5.2. %%/%
4.5.3. :n1:n2
4.5.4. #
4.5.5. example
4.6. Array
4.7. eval
5. conditions if and case
5.1. if
5.2. case
6. Loops for, while and until
6.1. for
6.2. while
6.3. until
7. Functions
7.1. Local variables
8. User interfaces
8.1. input
3. Z Shell
1. installing Z shell
2. Starting file
2.1. ~/.zshrc
3. Prompting
4. Aliases
5. History
6. FAQ
6.1. Home/End key
4. Shell TUI
1. terminal
1.1. resize - set TERMCAP and terminal settings to current xterm window size
1.2. tset, reset - terminal initialization
1.3. stty - change and print terminal line settings
2. tput
3. dialog
3.1. --inputbox
4. whiptail - display dialog boxes from shell scripts
4.1. --msgbox
4.2. --infobox
4.3. --yesno
4.4. --inputbox
4.5. --passwordbox
4.6. --textbox
4.7. --checklist
4.8. --radiolist
4.9. --menu
4.10. --gauge
5. Example
1. 有趣的Shell
2. backup
3. CPU 核心數
4. Password
5. processes
5.1. pid
5.2. kill
5.3. pgrep
6. Shell 技巧
6.1. 行轉列,再批評
6.2. for vs while
6.3. 遍歷字元串
II. System Commands
6. Help Commands
1. man - an interface to the on-line reference manuals
1.1. manpath.config
1.2. 查看man手冊位置
1.3. 指定手冊位置
7. Directory and File System Related
1. dirname
2. filename
2.1. 排除副檔名
2.2. 取副檔名
3. test - check file types and compare values
4. stat
5. mkdir - make directories
6. rename
7. touch
8. ls - list directory contents
9. cp - copy files and directories
9.1. copy directories recursively
9.2. overwrite an existing file
10. rm - remove files or directories
10.1. -bash: /bin/rm: Argument list too long
10.2. zsh: sure you want to delete all the files in /tmp [yn]?
11. df - report file system disk space usage
12. du - estimate file space usage
13. tac - concatenate and print files in reverse
14. find - search for files in a directory hierarchy
14.1. name
14.2. regex
14.3. user
14.4. perm
14.5. type
14.5.1. 分別設置檔案與目錄的權限
14.6. -delete
14.7. exec
14.8. xargs
14.9. 排除目錄
14.10. -mtime / -mmin
14.11. --newer
14.12. -print / -printf
8. package / compress and decompress
1. tar — The GNU version of the tar archiving utility
1.1. tar examples
1.2. gunzip
1.3. b2zip
1.4. compress
1.5. -t, --list
1.6. tar: Removing leading `/’ from member names
1.7. -C, --directory=DIR
1.8. --exclude
1.9. -T
1.10. 日期過濾
1.11. 保留權限
1.12. -r, --append
1.13. 遠程傳輸
1.14. 分卷壓縮
2. cpio - copy files to and from archives
3. gzip
4. zip, zipcloak, zipnote, zipsplit - package and compress (archive) files
5. RAR
6. 7-Zip
9. date and time
1. 日期格式
2. -d --date=
2.1. 日期偏移量
2.1.1. day
2.1.2. month
2.1.3. year
2.2. 時間偏移
3. weekday name
4. UTC
10. Numeric
1. 數值運算
2. seq - print a sequence of numbers
3. bc - An arbitrary precision calculator language
11. Text Processing
1. iconv - Convert encoding of given files from one encoding to another
1.1. cconv - A iconv based simplified-traditional chinese conversion tool
2. 字元串處理命令expr
3. cat - concatenate files and print on the standard output
3.1. -s, --squeeze-blank suppress repeated empty output lines
4. nl - number lines of files
5. od - dump files in octal and other formats
5.1. 16進制
6. tr - translate or delete characters
7. cut - remove sections from each line of files
8. printf - format and print data
9. Free `recode' converts files between various character sets and surfaces.
10. /dev/urandom 隨機字元串
11. col - filter reverse line feeds from input
12. apg - generates several random passwords
13. head/tail
14. grep, egrep, fgrep, rgrep - print lines matching a pattern
14.1. 刪除空行
14.2. -v, --invert-match
14.3. Output control
14.3.1. -o, --only-matching show only the part of a line matching PATTERN
14.3.2. 遞歸操作
14.3.3. -c, --count print only a count of matching lines per FILE
14.4. Context control
14.4.1. -A, --after-context=NUM print NUM lines of trailing context
14.4.2. -B, --before-context=NUM print NUM lines of leading context
14.4.3. -C, --context=NUM print NUM lines of output context
14.4.4. --color
14.5. Regexp selection and interpretation
14.5.1. .*
14.5.2. 2010:(13|14|15|16)
14.5.3. []與{}
14.6. ^M
14.7. egrep
15. sort - sort lines of text files
15.1. 對列排序
16. uniq
17. 行列轉換,表格操作
17.1. column - columnate lists
17.2. paste - merge lines of files
12. Logging
1. logger - a shell command interface to the syslog(3) system log module
13. Password
1. Shadow password suite configuration.
2. newusers - update and create new users in batch
3. chpasswd - update passwords in batch mode
14. binutils
1. strings - print the strings of printable characters in files.
15. Utility Programs
1. ed, red - text editor
2. vim
2.1. 查找與替換
2.2. 批處理
2.2.1. vi 批處理
2.3. line()
3. awk
3.1. 處理列
3.2. printf
3.3. 查找檔案並刪除
3.4. Pattern(字元匹配)
3.4.1. Pattern, Pattern
3.5. Built-in Variables
3.5.1. NF
3.6. Built-in Functions
3.6.1. length
3.7. 過濾相同的行
4. sed
4.1. find and replace
4.1.1. 正則
4.1.2. delete
4.1.3. aaa="bbb" 提取bbb
5. CURL - transfer a URL
5.1. 基本用法
5.2. data
5.3. connect-timeout
5.4. compressed
5.5. vhosts
5.6. http status
5.7. -A/--user-agent <agent string>
5.8. referer
5.9. -v
5.10. -o/--output <file>
5.11. -H/--header <line> Custom header to pass to server (H)
5.11.1. Last-Modified / If-Modified-Since
5.11.2. ETag / If-None-Match
5.11.3. Accept-Encoding:gzip,defalte
5.11.4. HOST
5.12. curl-config
5.13. FAQ
6. expect
6.1. 模擬登錄 telnet 獲取Cisco配置
6.2. 模擬登錄 ssh
6.3. SCP
7. Klish - Kommand Line Interface Shell (the fork of clish project)
7.1. 安裝Klish
7.2. 為用戶指定clish作為預設Shell
7.3. FAQ
7.3.1. clish/shell/shell_expat.c:36:19: fatal error: expat.h: No such file or directory
8. wget - retrieves files from the web
8.1. HTTP options
8.1.1. --post-data=STRING use the POST method; send STRING as the data.
8.2. Recursive download
8.2.1. -r, --recursive specify recursive download.
8.2.2. -m, --mirror shortcut for -N -r -l inf --no-remove-listing.
8.3. --no-passive-ftp disable the "passive" transfer mode.
9. screen - screen manager with VT100/ANSI terminal emulation
10. TUI
10.1. tmux
10.2. htop - interactive process viewer
10.3. elinks
10.4. chat
A. 附錄
1. Linux 下載排名
2. to convert utf-8 from gb2312 code
3. 使用內存的百分比
4. 合併apache被cronlog分割的log檔案
5. 參考文獻

表格清單

2.1. 檔案目錄表達式
2.2. 字元串表達式
2.3. 組合表達式

範例清單

2.1. A "Power User" Prompt
2.2. A Prompt the Width of Your Term
2.3. The Elegant Useless Clock Prompt
2.4. Basic conditional example if .. then
2.5. Conditionals with variables
2.6. case
2.7. Functions with parameters sample
2.8. Using select to make simple menus
2.9. Using the command line
2.10. Reading user input with read
2.11. read
4.1. whiptail - yesno
4.2. whiptail - inputbox
4.3. whiptail - passwordbox
4.4. whiptail - passwordbox
4.5. whiptail - example 1
4.6. whiptail - radiolist
5.1. random password
7.1. backup(find + tar)
15.1. example for expect
15.2. example for expect
15.3. example 1
15.4. *.exp
comments powered by Disqus