第 5 章 Shell command

目录

5.1. Help Commands
5.1.1. man - an interface to the on-line reference manuals
5.1.1.1. manpath.config
5.1.1.2. 查看man手册位置
5.1.1.3. 指定手册位置
5.2. getconf - Query system configuration variables
5.3. Directory and File System Related
5.3.1. dirname
5.3.2. filename
5.3.2.1. 排除扩展名
5.3.2.2. 取扩展名
5.3.3. test - check file types and compare values
5.3.4. file — determine file type
5.3.5. stat
5.3.6. mkdir - make directories
5.3.7. rename
5.3.8. touch
5.3.9. truncate
5.3.10. ls - list directory contents
5.3.10.1. full-time / time-style 定义日期时间格式
5.3.11. cp - copy files and directories
5.3.11.1. copy directories recursively
5.3.11.2. overwrite an existing file
5.3.11.3. -a, --archive same as -dR --preserve=all
5.3.12. rm - remove files or directories
5.3.12.1. -bash: /bin/rm: Argument list too long
5.3.12.2. zsh: sure you want to delete all the files in /tmp [yn]?
5.3.13. df - report file system disk space usage
5.3.14. du - estimate file space usage
5.3.15. tac - concatenate and print files in reverse
5.3.16. split - split a file into pieces
5.3.16.1. 按行分割文件
5.3.16.2. 按尺寸分割文件
5.3.17. find - search for files in a directory hierarchy
5.3.17.1. name
5.3.17.2. regex
5.3.17.3. user
5.3.17.4. perm
5.3.17.5. type
5.3.17.6. -delete
5.3.17.7. exec
5.3.17.8. 排除目录
5.3.17.9. -mmin n File's data was last modified n minutes ago.
5.3.17.10. -ctime
5.3.17.11. -mtime / -mmin
5.3.17.12. --newer
5.3.17.13. -print / -printf
5.3.17.14. -size
5.3.17.15. -path
5.3.17.16. -maxdepth
5.3.17.17. xargs
5.4. package / compress and decompress
5.4.1. tar — The GNU version of the tar archiving utility
5.4.1.1. tar examples
5.4.1.2. gunzip
5.4.1.3. b2zip
5.4.1.4. compress
5.4.1.5. -t, --list
5.4.1.6. tar: Removing leading `/’ from member names
5.4.1.7. -C, --directory=DIR
5.4.1.8. --exclude
5.4.1.9. -T
5.4.1.10. 日期过滤
5.4.1.11. 保留权限
5.4.1.12. -r, --append
5.4.1.13. 远程传输
5.4.1.14. 分卷压缩
5.4.2. cpio - copy files to and from archives
5.4.3. gzip
5.4.4. zip, zipcloak, zipnote, zipsplit - package and compress (archive) files
5.4.5. RAR
5.4.6. 7-Zip
5.4.6.1. 压缩
5.4.6.2. 浏览压缩包
5.4.6.3. 解压
5.4.6.4. Creates self extracting archive.
5.4.7.
5.5. date and time
5.5.1. 日期格式
5.5.1.1. weekday name
5.5.2. -d --date=
5.5.2.1. 日期偏移量
5.5.2.2. 时间偏移
5.5.3. 时间戳
5.5.4. RFC 2822
5.5.5. UTC
5.6. Numeric
5.6.1. 数值运算
5.6.2. seq - print a sequence of numbers
5.6.3. bc - An arbitrary precision calculator language
5.7. Text Processing
5.7.1. iconv - Convert encoding of given files from one encoding to another
5.7.1.1. cconv - A iconv based simplified-traditional chinese conversion tool
5.7.1.2. uconv - convert data from one encoding to another
5.7.2. 字符串处理命令expr
5.7.3. cat - concatenate files and print on the standard output
5.7.3.1. -s, --squeeze-blank suppress repeated empty output lines
5.7.3.2. -v, --show-nonprinting use ^ and M- notation, except for LFD and TAB
5.7.4. nl - number lines of files
5.7.5. od - dump files in octal and other formats
5.7.5.1. 16进制
5.7.6. tr - translate or delete characters
5.7.7. cut - remove sections from each line of files
5.7.8. printf - format and print data
5.7.9. Free `recode' converts files between various character sets and surfaces.
5.7.10. /dev/urandom 随机字符串
5.7.11. col - filter reverse line feeds from input
5.7.12. apg - generates several random passwords
5.7.13. head/tail
5.7.14. 反转字符串或文件内容
5.8. grep, egrep, fgrep, rgrep - print lines matching a pattern
5.8.1. 删除空行
5.8.2. -v, --invert-match
5.8.3. Output control
5.8.3.1. -o, --only-matching show only the part of a line matching PATTERN
5.8.3.2. 递归操作
5.8.3.3. -c, --count print only a count of matching lines per FILE
5.8.4. Context control
5.8.4.1. -A, --after-context=NUM print NUM lines of trailing context
5.8.4.2. -B, --before-context=NUM print NUM lines of leading context
5.8.4.3. -C, --context=NUM print NUM lines of output context
5.8.4.4. --color
5.8.5. Regexp selection and interpretation
5.8.5.1. .*
5.8.5.2. 2010:(13|14|15|16)
5.8.5.3. []与{}
5.8.5.4. -P, --perl-regexp Perl正则表达式
5.8.6. fgrep
5.8.7. egrep
5.9. sort - sort lines of text files
5.9.1. 对列排序
5.9.2. -s, --stable stabilize sort by disabling last-resort comparison
5.10. uniq
5.11. 表格操作/行列转换
5.11.1. column - columnate lists
5.11.2. paste - merge lines of files
5.11.3. join
5.12. standard input/output
5.12.1. xargs - build and execute command lines from standard input
5.12.1.1. 格式化
5.12.1.2. standard input
5.12.1.3. -I 替换操作
5.12.1.4. -n, --max-args=MAX-ARGS use at most MAX-ARGS arguments per command line
5.12.1.5. -t, --verbose print commands before executing them
5.12.1.6. -d, --delimiter=CHARACTER items in input stream are separated by CHARACTER, not by whitespace; disables quote and backslash processing and logical EOF processing
5.12.1.7. -0, --null items are separated by a null, not whitespace; disables quote and backslash processing and logical EOF processing
5.12.1.8. -r, --no-run-if-empty if there are no arguments, then do not run COMMAND; if this option is not given, COMMAND will be
5.12.1.9. -p, --interactive prompt before running commands
5.13. flock - manage locks from shell scripts
5.14. Logging
5.14.1. logger - a shell command interface to the syslog(3) system log module
5.15. Password
5.15.1. Shadow password suite configuration.
5.15.2. newusers - update and create new users in batch
5.15.3. chpasswd - update passwords in batch mode
5.16. binutils
5.16.1. strings - print the strings of printable characters in files.

5.1. Help Commands

5.1.1. man - an interface to the on-line reference manuals

5.1.1.1. manpath.config

cat /etc/manpath.config
			

5.1.1.2. 查看man手册位置

$ man -aw ls
/usr/share/man/man1/ls.1.gz
			

5.1.1.3. 指定手册位置

man -M /home/mysql/man mysql
			

原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

时间: 2024-09-20 09:27:41

第 5 章 Shell command的相关文章

第 27 章 Shell command

27.1. Help Commands 27.1.1. man - an interface to the on-line reference manuals 27.1.1.1. manpath.config cat /etc/manpath.config 27.1.1.2. 查看man手册位置 $ man -aw ls /usr/share/man/man1/ls.1.gz 27.1.1.3. 指定手册位置 man -M /home/mysql/man mysql 原文出处:Netkiller

29.13. parallel - build and execute shell command lines from standard input in parallel

并行执行shell命令 $ sudo apt-get install parallel 例 29.5. parallel - build and execute shell command lines from standard input in parallel $ cat *.csv | parallel --pipe grep '13113' 设置块大小 $ cat *.csv | parallel --block 10M --pipe grep '131136688' 原文出处:Netk

I.MX6 Android shutdown shell command

/******************************************************************************* * I.MX6 Android shutdown shell command * 说明: * 想在I.MX6上执行shell关机命令,不过效果貌似不是很好,开关键多按两下又亮了. * * 2016-7-25 深圳 南山平山村 曾剑锋 ****************************************************

7.13. parallel - build and execute shell command lines from standard input in parallel

并行执行shell命令 $ sudo apt-get install parallel 例 7.5. parallel - build and execute shell command lines from standard input in parallel $ cat *.csv | parallel --pipe grep '13113' 设置块大小 $ cat *.csv | parallel --block 10M --pipe grep '131136688' 原文出处:Netki

Android shell command execute Demo

1 package com.android.utils; 2 3 4 import java.io.File; 5 6 import java.io.IOException; 7 import java.io.InputStream; 8 import java.util.ArrayList; 9 import java.util.List; 10 11 /** 12 * 本类主要用于在Java层执行Linux shell命令,获取一些系统下的信息 13 * 本例中的dmesg需要一些额外的权限

第 8 章 Shell Terminal

dialog, whiptail, gdialog, kdialog and nautilus 目录 8.1. terminal 8.1.1. resize - set TERMCAP and terminal settings to current xterm window size 8.1.2. tset, reset - terminal initialization 8.1.3. stty - change and print terminal line settings 8.2. tp

第 30 章 Shell Terminal

30.1. terminal 30.1.1. resize - set TERMCAP and terminal settings to current xterm window size 显示终端屏幕的尺寸 $ resize COLUMNS=151; LINES=46; export COLUMNS LINES; 设置终端屏幕的尺寸 eval `resize` 30.1.2. tset, reset - terminal initialization tset -e ^? 设置Backspac

linux shell中的单引号与双引号的区别(看完就不会有引号的疑问了)(转)

tips: ============================= IFS - LINUX字段分隔符,内部字段分隔符 IFS(Internal Field Seperator)在Linux的shell中预设的分隔符,用来把command line分解成word(字段). IFS可以是White Space(空白键).Tab( 表格键).Enter( 回车键)中的一个或几个. IFS是shell脚本中的一个重要概念,在处理文本数据时,它是相当有用的.内部字段分隔符是用于特定用途的定界符.IFS

shell脚本学习指南[六](Arnold Robbins & Nelson H.F. Beebe著)_linux shell

学shell到现在了,一直以为自己不会犯一个大家常说的非常二的问题,结果这本书最后的时候犯了个十分2的事,晚节不保啊!!!我在测试文件路径下除了通配符*和?外还能用啥正则那样的东西,结果就在$HOME下执行了rm .* ...好吧,蛋疼了一下午!还木找回任何一个配置文件.警示后人,千万别使用rm试通配符!任何时候小心使用rm! 第十四章shell可移植性议题和扩展 可以先通读这篇文章.想写出好的可移植性shell,不仅要了解各种shell版本间的差异,还要有很多编程技巧,比如尽量从环境变量中获取