随笔分类 -  Shell

摘要:第一种:〔 Python 与 Bash Shell 的结合 〕这个命令会让你输入一个字符串,然后会再输出一串加密了的数字。加密代码[照直输入]:python -c 'print reduce(lambda a,b: a*256+ord(b), raw_input("string: "), 0)'解密 阅读全文
posted @ 2018-10-15 18:26 kakaisgood 阅读(963) 评论(0) 推荐(0)
摘要:function GetPasswd { RunCounter=1 DB_PSSWD=getpassword while [ -z "${DB_PSSWD}" -a ${RunCounter} -le 20 ] ; do DB_PSSWD=getpassword sleep 3 ## To address error "Cannot open /proc/net/tcp" and retr... 阅读全文
posted @ 2018-10-15 11:12 kakaisgood 阅读(128) 评论(0) 推荐(0)
摘要:or 阅读全文
posted @ 2018-10-11 15:18 kakaisgood 阅读(147) 评论(0) 推荐(0)
摘要:find . -type f -print0 | xargs -0 chmod 644 阅读全文
posted @ 2018-10-11 15:17 kakaisgood 阅读(84) 评论(0) 推荐(0)
摘要:ls -l | awk '$3=="userid"' 阅读全文
posted @ 2018-10-09 09:28 kakaisgood 阅读(304) 评论(0) 推荐(0)
摘要:Chmod命令修改目录权限数字含义 常见的目录权限: -rw——- (600) — 只有属主有读写权限。 -rw-r–r– (644) — 只有属主有读写权限;而属组用户和其他用户只有读权限。 -rwx—— (700) — 只有属主有读、写、执行权限。 -rwxr-xr-x (755) — 属主有读 阅读全文
posted @ 2018-10-08 13:54 kakaisgood 阅读(262) 评论(0) 推荐(0)
摘要:功能说明:查找文件里符合条件的字符串。 语 法:grep [-abcEFGhHilLnqrsvVwxy][-A<显示列数>][-B<显示列数>][-C<显示列数>][-d<进行动作>][-e<范本样式>][-f<范本文件>][--help][范本样式][文件或目录...] 补充说明:grep 指令用 阅读全文
posted @ 2018-09-18 17:15 kakaisgood 阅读(8750) 评论(0) 推荐(0)
摘要:https://coolshell.cn/articles/9070.html 我从netstat命令中提取了如下信息作为用例: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 $ cat netstat.txt Proto Recv-Q Sen 阅读全文
posted @ 2018-09-18 16:08 kakaisgood 阅读(219) 评论(0) 推荐(0)
摘要:http://www.gnu.org/software/sed/manual/sed.html 阅读全文
posted @ 2018-09-18 10:14 kakaisgood 阅读(263) 评论(0) 推荐(0)
摘要:选项与参数:-n :使用安静(silent)模式。在一般 sed 的用法中,所有来自 STDIN 的数据一般都会被列出到终端上。但如果加上 -n 参数后,则只有经过sed 特殊处理的那一行(或者动作)才会被列出来。-e :直接在命令列模式上进行 sed 的动作编辑;-f :直接将 sed 的动作写在 阅读全文
posted @ 2018-09-17 16:50 kakaisgood 阅读(143) 评论(0) 推荐(0)
摘要:sed 是一种在线编辑器,它一次处理一行内容。处理时,把当前处理的行存储在临时缓冲区中,称为“模式空间”(pattern space),接着用sed命令处理缓冲区中的内容,处理完成后,把缓冲区的内容送往屏幕。接着处理下一行,这样不断重复,直到文件末尾。文件内容并没有 改变,除非你使用重定向存储输出。 阅读全文
posted @ 2018-09-17 16:18 kakaisgood 阅读(212) 评论(0) 推荐(0)
摘要:sed: awk: 阅读全文
posted @ 2018-09-17 16:12 kakaisgood 阅读(615) 评论(0) 推荐(0)
摘要:正斜杠(/)和反斜杠(\)的区别 在unix系统中,正斜杠/表示目录。 ... 微软在开发DOS2.0的时候,从UNIX中借鉴了这种目录结构,但由于DOS中,斜杠已经用了作为命令行参数的标志了(UNIX中用的是"-"符),所以只得使用反斜杠:\ 阅读全文
posted @ 2018-09-14 10:28 kakaisgood 阅读(1429) 评论(0) 推荐(0)
摘要:If you wish to use SQL*Plus Command-line , you'll simply issue the sqlplus command from your shell: $ sqlplus. $ sqlplusschema@//machine.domain:port/d 阅读全文
posted @ 2018-08-01 12:08 kakaisgood 阅读(248) 评论(0) 推荐(0)
摘要:awk '/blah/{getline; print}' logfile 阅读全文
posted @ 2018-07-20 18:52 kakaisgood 阅读(120) 评论(0) 推荐(0)
摘要:命令太多,记不住,组合起来用一把…..示例文件: 1 2 3 4 5 6 7 8 9 10 11 [root@lovedan test]# cat a.txt hello good world hello hello good dandan good hello world 场景/分析: 统计a.t 阅读全文
posted @ 2018-07-10 16:48 kakaisgood 阅读(1724) 评论(0) 推荐(0)
摘要:bash-4.1$ find . -name '*prev' 阅读全文
posted @ 2018-06-12 19:45 kakaisgood 阅读(204) 评论(0) 推荐(0)
摘要:yy or Y to copy the line or dd to delete (cutting) the line then p to paste the copied or deleted text after the current line or P to paste the copied 阅读全文
posted @ 2018-06-06 16:42 kakaisgood 阅读(192) 评论(0) 推荐(0)
摘要:cat filename | hexdump –C tail -行数 filename | hexdump –C head -行数 filename | hexdump -C 阅读全文
posted @ 2018-05-04 10:19 kakaisgood 阅读(317) 评论(0) 推荐(0)
摘要:查找目录:find /(查找范围) -name '查找关键字' -type d 阅读全文
posted @ 2018-04-18 11:05 kakaisgood 阅读(447) 评论(0) 推荐(0)