随笔分类 -  脚本

摘要:之前跑内存泄漏时,用到 1>file_res.std 2>&1 "2>&1" "2>1" 的意思等于 "STDERR 给输出到文件 1",再加上论文要特别 "&1" 代表是引用 "STDOUT",而不是文件 今天看到bash_redirection文档,来看看别人怎么说 "1 > file 2>&1 阅读全文
posted @ 2025-05-17 21:51 codestacklinuxer 阅读(14) 评论(0) 推荐(0)
该文被密码保护。
posted @ 2022-07-04 10:36 codestacklinuxer 阅读(47) 评论(0) 推荐(0)
摘要:那么什么是shell脚本呢? shell脚本就是由Shell命令组成的执行文件,将一些命令整合到一个文件中,进行处理业务逻辑,脚本不用编译即可运行。它通过解释器解释运行,所以速度相对来说比较慢。 shell脚本中最重要的就是对shell命令的使用与组合,再使用shell脚本支持的一些语言特性,完成想 阅读全文
posted @ 2022-01-17 15:22 codestacklinuxer 阅读(295) 评论(0) 推荐(0)
摘要:exec 是 bash 的内置命令 shell 的内件命令exec执行命令时,不启用新的shell进程。 source 和 . 不启用新的shell,在当前shell中执行,设定的局部变量在执行完命令后仍然有效。 bash 或 sh 或 shell script 执行时,另起一个子shell,其继承 阅读全文
posted @ 2022-01-13 10:55 codestacklinuxer 阅读(5230) 评论(0) 推荐(0)
摘要:while sleep 1; do cat /proc/slabinfo | awk '{name=$1; size=$2*$4/4096; \ printf "%s %lu\n", name, size;}' | sort -n -r -k 2 | head -n 20; \ echo " ";d 阅读全文
posted @ 2021-09-15 11:19 codestacklinuxer 阅读(110) 评论(0) 推荐(0)
摘要:for i in `ps -AL |grep Worker | awk '{print $2}'`; do \ echo $i ; \ gdb --q --n --ex bt --batch --pid $i; \ done 2>&1 |tee /var/stacks.txt CPU使用率较低但负载 阅读全文
posted @ 2021-05-20 18:39 codestacklinuxer 阅读(865) 评论(0) 推荐(0)
摘要:1、 进程状态一共有如下5种 R(运行):进程正在运行或在运行队列中等待。 T(停止):进程收到停止信号后停止运行。 Z(僵死):进程已经终止,但进程描述符依然存在, 直到父进程调用wait4()系统函数后将进程释放。 S(中断):进程处于休眠中,当某个条件形成后或者接收到信号时,则脱离该状态。 D 阅读全文
posted @ 2021-04-26 09:52 codestacklinuxer 阅读(84) 评论(0) 推荐(0)
摘要:https://0xfe.com.cn/post/6b78731.html 废话不多说: 其shell 脚本为: #!/bin/bash # # Copyright (c) 2015, Intel Corporation # # Redistribution and use in source an 阅读全文
posted @ 2021-04-25 17:53 codestacklinuxer 阅读(684) 评论(0) 推荐(0)
摘要:前景:一套代码要在两个平台上使用,涉及到x86以及ARM编译,其使用的代码绝大部分相同,只是小部分不一样! 目前状态:目前一份一样的代码在svn 上分了两份存储,一份给x86编译使用另一份给ARM编译使用,每份代码上的编译器已经写死!!! 竟然弄了两份svn 目录一份x86一份arm;作为一个见不得 阅读全文
posted @ 2021-01-12 20:01 codestacklinuxer 阅读(194) 评论(0) 推荐(0)
摘要:vim 的insert data 阅读全文
posted @ 2020-10-10 22:27 codestacklinuxer 阅读(215) 评论(0) 推荐(0)