小编Che*_*eng的帖子

为什么`htop`比`ps`显示更多进程

ps xf

26395 pts/78   Ss     0:00  \_ bash
27016 pts/78   Sl+    0:04  |   \_ unicorn_rails master -c config/unicorn.rb                                           
27042 pts/78   Sl+    0:00  |       \_ unicorn_rails worker[0] -c config/unicorn.rb                                        
Run Code Online (Sandbox Code Playgroud)

在 中htop,它显示为: htop 显示多条 unicorn_rails 行

为什么 htop 显示的进程比 ps 多?

process top ps thread htop

231
推荐指数
1
解决办法
11万
查看次数

通过 rsync 从 dest 目录中删除无关文件?

说我有

SRC 
  001.jpg
  002.jpg
  001.txt
  a.zip

DEST
  hello.jpg
Run Code Online (Sandbox Code Playgroud)

rsync -d --delete SRC:{*.jpg,*.txt} DEST

它不会从 DEST 中删除 hello.jpg,知道如何存档吗?

rsync

51
推荐指数
1
解决办法
5万
查看次数

在 Bash 中获取当前目录中的可用空间

我知道df -hand pwd,但对于正则表达式匹配部分来说似乎有点复杂。有任何想法吗?

bash

36
推荐指数
3
解决办法
11万
查看次数

33
推荐指数
2
解决办法
1万
查看次数

在shebang中使用`/usr/bin/env sed -f`的方法?

输入/usr/bin/env sed -f终端工作。

但如果将其用作shebang,

#!/usr/bin/env sed -f 
s/a/b/
Run Code Online (Sandbox Code Playgroud)

脚本将无法执行:

/usr/bin/env: sed -f: No such file or directory
Run Code Online (Sandbox Code Playgroud)

我有点相信它与-f有关。但是如何解决这个问题呢?

scripting sed executable env

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

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

使用sed对大文件进行有效的就地头文件删除?

以下命令可能需要几分钟,具体取决于文件大小。有没有更有效的方法?

sed -i 1d large_file 
Run Code Online (Sandbox Code Playgroud)

sed text-processing

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

如何让`named`(bind9)将某些域转发到不同的名称服务器?

在 中dnsmasq,可以将域转发到不同的名称服务器。我怎样才能做到这一点named

server=/foo.com/10.0.10.1
server=/vpn.foo.com/8.8.8.8
Run Code Online (Sandbox Code Playgroud)

dns bind

20
推荐指数
1
解决办法
3万
查看次数

如何在启用 SuperTab 插件的情况下在 vim 中输入制表符?

如何在启用 SuperTab 插件的情况下在 vim 中输入制表符?

vim

15
推荐指数
1
解决办法
5875
查看次数

在一个命令中同步两种文件类型?

如何将它们写成一行,也不重复相同的路径?

rsync -a root@somewhere:/folder/remote/*.txt .
rsync -a root@somewhere:/folder/remote/*.jpg .
Run Code Online (Sandbox Code Playgroud)

shell rsync

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

标签 统计

rsync ×2

sed ×2

text-processing ×2

bash ×1

bind ×1

dns ×1

env ×1

executable ×1

htop ×1

linux ×1

process ×1

ps ×1

scripting ×1

shell ×1

swap ×1

thread ×1

top ×1

vim ×1