小编C. *_*sti的帖子

确定由 root 运行的所有进程,显示 2 列:pid,cmd

我做了什么: ps -ax -o pid,cmd,user | grep root但这显示了 3 列显示包含根的列,如何消除“根”列?

linux process ps

4
推荐指数
1
解决办法
131
查看次数

使用 shell 脚本添加文件大小

我想使用 shell 脚本添加和回显几个文件的总和。我该如何开始?我有一个这样的列表:

$ stat /etc/*.conf | grep Size | cut -f4 -d' '
123
456
789
101112
Run Code Online (Sandbox Code Playgroud)

shell shell-script

2
推荐指数
4
解决办法
934
查看次数

在列中搜索确切的字符串

我有一个文件,其中的单词以 ',' 分隔,每一行都有相同数量的单词,比如说 4。所以它们的形式是:

something1,something2,something3,something4

我想搜索包含在第 4 列中的行something4,但是如果存在另一行是这样的,我该怎么做:

something1,something2,something3,1_something4

使用 grep 我会得到这两行,但我只想要第 4 个元素的行,something4我该怎么办?

grep text-processing

2
推荐指数
2
解决办法
5916
查看次数

标签 统计

grep ×1

linux ×1

process ×1

ps ×1

shell ×1

shell-script ×1

text-processing ×1