我正在学习使用Linux终端,它似乎不像我所期望的那样起作用,我想了解原因。
我有两份文件:
File1
John 1
Paul 2
Peter 3
Henry 5
File2
John 2
Peter 7
Francis 5
我的想法是订购File2,然后使用以下命令将有序的结果与File1连接起来:
sort -k2n File2 | join -1 2 -2 2 File1 File2
我料到结果是
2 John Paul
5 Francis Henry
但是,它似乎并没有在管道和返回之前订购:
2 John Paul
join: File2:3: is not
有没有一种方法可以在Emacs模式中批量反转标题的顺序?我想更改这类列表(,但要大得多,而不仅仅是两三项,因此“散装”):
* personal computer
* Windows
* Mac
* Linux
* StackExchange
* stackoverflow
* countries
* people
对此:
* people
* countries
* StackExchange
* stackoverflow
* personal computer
* Windows
* Mac
* Linux
在一个新的ubunto上,我安装了docker,当我运行镜像时,我得到了以下错误 docker: Error response from daemon: failed to create shim: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "--gpus": executable file not found in $PATH: unknown.
ERRO[0000] error waiting for container: cont
我需要按第一列对文件进行排序,如果第一列中有数字条目,则按第二列排序。它基本上看起来是这样的:
3 - foo bar
1 1 foo bar
- 5 foo bar
2 2 foo bar
- 4 foo bar
我需要输出结果是
1 1 foo bar
2 2 foo bar
3 - foo bar
- 4 foo bar
- 5 foo bar
在linux中,有没有用一条命令就能做到这一点的好方法?谢谢!