Zhang Jiuan’ Notes

shell文件存在相关判断参数

The tests below are test conditions provided by the shell:
    * -b file = True if the file exists and is block special file.
    * -c file = True if the file exists and is character special file.
    * -d file = True if the file exists and is a directory.
    * -e file = [...]

linux seq更为详细的用法

 
以前使for i in提时候对于01 11而烦恼,可查了一把seq,发现还有其它的特点。
seq命令的作用就是打印出一串有序的数字,它主要有以下3个参数构成:
       -f, –format=FORMAT 
              use printf style floating-point FORMAT (default: %g)
-f 指定打印的格式:
例如:
[root@hao32]# seq -f %05g 2 7 
00002
00003
00004
00005
00006
00007
       -s, –separator=STRING
              use STRING to separate numbers (default: \n)
-s 指定分隔符 默认是回车:
例如:
[root@hao32]# seq -s” ” 2 7
2 3 4 5 6 7
       -w, –equal-width
              equalize width by padding with leading zeroes
-w 输出是同宽 前面不足的用 “0″ 补全,即与位数最多的数对齐
例如:
[root@hao32]# seq -w [...]

,

返回顶部