Shell语法整理,持续维护
Shell
shell条件表达式:
CONDITIONAL EXPRESSIONS
Conditional expressions are used by the [[ compound command and the test and [ builtin commands to test file attributes and perform string and arithmetic comparisons. Expressions are formed from the following unary or
binary primaries. If any file argument to one of the primaries is of the form /dev/fd/n, then file descriptor n is checked. If the file argument to one of the primaries is one of /dev/stdin, /dev/stdout, or /dev/stderr,
file descriptor 0, 1, or 2, respectively, is checked.Unless otherwise specified, primaries that operate on files follow symbolic links and operate on the target of the link, rather than the link itself.
When used with [[, the < and > operators sort lexicographically using the current locale. The test command sorts using ASCII ordering.
-a file
True if file exists.
-b file
True if file exists and is a block special file.
-c file
True if file exists and is a character special file.
-d file
True if file exists and is a directory.
-e file
True if file exists.
-f file
True if file exists and is a regular file.
-g file
True if file exists and is set-group-id.
-h file
True if file exists and is a symbolic link.
-k file
True if file exists and its ``sticky'' bit is set.
-p file
True if file exists and is a named pipe (FIFO).
-r file
True if file exists and is readable.
-s file
True if file exists and has a size greater than zero.
-t fd True if file descriptor fd is open and refers to a terminal.
-u file
True if file exists and its set-user-id bit is set.
-w file
True if file exists and is writable.
-x file
True if file exists and is executable.
-G file
True if file exists and is owned by the effective group id.
-L file
True if file exists and is a symbolic link.
-N file
True if file exists and has been modified since it was last read.
-O file
True if file exists and is owned by the effective user id.
-S file
True if file exists and is a socket.
file1 -ef file2
True if file1 and file2 refer to the same device and inode numbers.
file1 -nt file2
True if file1 is newer (according to modification date) than file2, or if file1 exists and file2 does not.
file1 -ot file2
True if file1 is older than file2, or if file2 exists and file1 does not.
-o optname
True if the shell option optname is enabled. See the list of options under the description of the -o option to the set builtin below.
-v varname
True if the shell variable varname is set (has been assigned a value).
-z string
True if the length of string is zero.string
-n string
True if the length of string is non-zero.string1 == string2
string1 = string2
True if the strings are equal. = should be used with the test command for POSIX conformance.string1 != string2
True if the strings are not equal.string1 < string2
True if string1 sorts before string2 lexicographically.string1 > string2
True if string1 sorts after string2 lexicographically.arg1 OP arg2
OP is one of -eq, -ne, -lt, -le, -gt, or -ge. These arithmetic binary operators return true if arg1 is equal to, not equal to, less than, less than or equal to, greater than, or greater than or equal to arg2, respec‐
tively. Arg1 and arg2 may be positive or negative integers.
Shell语法整理,持续维护的更多相关文章
- BAT 前端开发面经 —— 吐血总结 前端相关片段整理——持续更新 前端基础精简总结 Web Storage You don't know js
BAT 前端开发面经 —— 吐血总结 目录 1. Tencent 2. 阿里 3. 百度 更好阅读,请移步这里 聊之前 最近暑期实习招聘已经开始,个人目前参加了阿里的内推及腾讯和百度的实习生招聘, ...
- 2018年最新Java面试题及答案整理(持续完善中…)
2018年最新Java面试题及答案整理(持续完善中…) 基础篇 基本功 面向对象特征 封装,继承,多态和抽象 封装封装给对象提供了隐藏内部特性和行为的能力.对象提供一些能被其他对象访问的方法来改变它内 ...
- Markdown 语法整理
Markdown 语法整理 白宁超 2015年7月24日14:57:49 一.字体设置 A First Level Header == A Second Level Header -- # 标题 ## ...
- makefile中的shell语法
在Makefile中写shell代码有点诡异,和不同的shell语法不太一样,如果不了解,看Makefile会莫名其妙.下面总结了一些. 1:尽在Makefile文件的目标项冒号后的另起一行的代码才是 ...
- 常用的shell命令整理
工作快一年了,shell命令也玩了一年了.还是有点积累的,下面是本人常用的. 1.pwd | xargs -i basename {} 获取当前所在目录的名称 2.ps -ef|grep -w ...
- 开源项目商业模式分析(2) - 持续维护的重要性 - Selenium和WatiN
该系列第一篇发布后收到不少反馈,包括: 第一篇里说的MonicaHQ不一定盈利 没错,但是问题在于绝大多数开源项目商业数据并没有公开,从而无法判断其具体是否盈利.难得MonicaHQ是公开的,所以才用 ...
- JQuery插件之【jqGrid】常用语法整理
jqGrid常用语法整理,包含数据获取.常用函数.触发事件等 jqGrid表格数据获取相关语法 获取表格所有数据 $("#grid").jqGrid("getRowDat ...
- Markdown语法整理
标题 语法格式:'#'+'空格'+'文本',一共6级 # 一级标题 ## 二级标题 ### 三级标题 #### 四级标题 ##### 五级标题 ###### 六级标题 斜体 语法格式:1个星号包裹,我 ...
- Linux的经典shell命令整理
Linux的经典shell命令整理 1.删除0字节文件find -type f -size 0 -exec rm -rf {} \; 2.查看进程按内存从大到小排列ps -e -o “%C : %p ...
随机推荐
- 炫酷霸气的HTML5/jQuery应用及源码
也许在5年前,HTML5还是一种很前卫的技术,大家还只是将它当做实验来看待,更别说产品应用了.但是现在HTML5已经非常流行,无论从PC端还是移动端,HTML5都扮演着非常重要的角色.今天我们要分享的 ...
- memcached系列之
Slab Allocator的机制分配.管理内存 slabs---->slabs class:chunk size------>申请内存后分配的规格. chunk-->存放记录的单位 ...
- [转] fitnesse中的Map处理
http://blog.csdn.net/doubeizhucele/article/details/42263887 fintesse会把!{}标记的变量视为HashTable对象,展现到页面上的将 ...
- MathType如何设置标尺的单位
MathType在编辑公式的时候,经常会需要将公式对齐.在将公式对齐的这个过程中,有时候会用到标尺,这样可以更精确的定位公式的位置.我们在使用标尺的时候,有时候会发现标尺上显示的是英寸,而我们平常已经 ...
- MVC阻止用户注入JavaScript代码或者Html标记
使用HttpUtility.HtmlEncode("")将字符串进行过滤处理
- PHP的五大阶段
PHP程序员必须懂前端,后端,数据库,服务器.具体的学习顺序是: 第一阶段:扫盲.了解什么是B/S模式,原理上知道从浏览器输入一个url是如何获取到信息的流程.熟悉html,能快速地用div+css写 ...
- 【jmeter】 jmeter 测试HTTP接口
到apache官网下载jmeter:http://jmeter.apache.org/download_jmeter.cgi 1.运行 bin/jmeter.bat ,添加线程组 2.添加HTTP请求 ...
- 苹果官方xcodeprojectbuild设置指南
https://developer.apple.com/library/ios/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/ ...
- web.xml 整合 SpringMVC
啦啦啦 <context-param> <param-name>defaultHtmlEscape</param-name> <param-value> ...
- C++ mysql 乱码
C++读mysql数据库中的中文显示出来的是乱码 在连接到数据库后加上这么一句 mysql_query(pMYSQL, "SET NAMES GB2312"); 或者 mysql_ ...