随笔分类 -  Linux(shell)

摘要:wc wc -l /etc/passwd(统计行数) wc -w /etc/passwd(统计单词个数) wc -c /etc/passwd(统计字符个数) wc -lwc /etc/passwd(统计文件中行数、单词个数、字符个数) cut命令可以从一个文本文件或者文本流中提取文本列。 cat / 阅读全文
posted @ 2017-02-27 22:52 奋斗的珞珞 阅读(347) 评论(0) 推荐(0)
摘要:arr=(a b c) arr[index]=a arr=(a b c) arr[index]=a 2.常用的两个方法 str=${arr[@]}(数组转化成字符串) len=${#arr[*]}(数组长度) str=${arr[@]}(数组转化成字符串) len=${#arr[*]}(数组长度) 阅读全文
posted @ 2017-02-15 23:36 奋斗的珞珞 阅读(8469) 评论(0) 推荐(0)
摘要:字符串长度 查找子串的位置 选取子串 字符串替换 字符串连接 阅读全文
posted @ 2017-01-10 00:33 奋斗的珞珞 阅读(1711) 评论(0) 推荐(0)
摘要:let 命令 a=1 b=2 let c=a+B echo $c let a++ let b++ echo $a $b []方法 []方法 a=1 b=2 echo $[a+b] echo $[$a+$b] (()) 方法 (()) 方法 a=1 b=2 echo $((a+b)) expr 方法 阅读全文
posted @ 2017-01-09 23:33 奋斗的珞珞 阅读(372) 评论(0) 推荐(0)