摘要:
cat主要有三大功能:1.一次显示整个文件。$ cat filename2.从键盘创建一个文件。$ cat > filename只能创建新文件,不能编辑已有文件.3.将几个文件合并为一个文件。$cat file1 file2 > filecat具体命令格式为 : cat [-AbeEnstTuv] [--help] [--version] fileName说明:把档案串连接后传到基本输出(屏幕或加 > fileName 到另一个档案)参数:-n 或 –number 由 1 开始对所有输出的行数编号-b 或 –number-nonblank 和 -n 相似,只不过对于空白行不编 阅读全文
摘要:
\a alert (bell) \b backspace\e an escape character \f form feed\n newline \r carriage return\t horizontal tab \v vertical tab\\ backslash \` single quote\nnn octal value of characters ( see [http://www.asciitable.com/ ASCII table] ) \xnn hexadecimal value of characters ( see [http://www.asciitable.c 阅读全文
摘要:
-b filename Block special file-c filename Special character file-d directoryname Check for directory existence-e filename Check for file existence-f filename Check for regular file existence not a directory-G filename Check if file exists and is owned by effective group ID.-g filename true if file e 阅读全文
摘要:
= equal!= not equal< less then> greater then-n s1 string s1 is not empty-z s1 string s1 is empty 阅读全文
摘要:
-lt <-gt >-le <=-ge >=-eq ==-ne != 阅读全文
摘要:
for x in one two three fourdo echo number $xdonefor myfile in /etc/r*do if [ -d "$myfile" ] then echo "$myfile (dir)" else echo "$myfile" fidonefor x in /etc/r??? /var/lo* /home/drobbins/mystuff/* /tmp/${MYPATH}/*do cp $x /mnt/mydirdonewhile [ condition ]do statementsdo 阅读全文
摘要:
environment variable "$1", which referred to the first command-line argument. Similarly, you can use "$2", "$3", etc. to refer to the second and third arguments passed to your script.ex#!/usr/bin/env bashecho name of script is $0echo first argument is $1echo second argu 阅读全文