小编Aru*_*run的帖子

在reverse-i-search(Ctrl + R)中,任何在历史记录中切换类似命令的方法

我想一个例子可以很好地理解我的问题.

...
scp file1 user10@192.168.10.1:/home/user1/linuxfiles/samplecode/important
...
...
scp file1 user10@192.168.10.1:/home/user1/linuxfiles/samplecode/important/tested
...
...
Run Code Online (Sandbox Code Playgroud)

假设这是历史中命令的顺序.如果我正在做Ctrl+ R并键入scp它将显示最后执行的scp命令(即以'tests'结尾的行).

但我想找到以'important'结尾的scp命令.那么有什么办法reverse-i-search可以查看以scp开头的所有命令来选择合适的命令吗?

linux bash command-line

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

未找到“kubectl”。如果您需要它,请尝试:“minikube kubectl -- get pods -A”

我安装minikubeWindows 10. 我可以开始minikube

**C:\WINDOWS\system32>minikube start
* minikube v1.15.1 on Microsoft Windows 10 Pro 10.0.18363 Build 18363
* Using the hyperv driver based on existing profile
* Starting control plane node minikube in cluster minikube
* Restarting existing hyperv VM for "minikube" ...
* Preparing Kubernetes v1.19.4 on Docker 19.03.13 ...
* Verifying Kubernetes components...
* Enabled addons: storage-provisioner, default-storageclass
* kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'
* …
Run Code Online (Sandbox Code Playgroud)

kubernetes windows-10 kubectl minikube

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

去'mod init'创建新文件夹?路径的意义是什么?

只需 3 天的 Go 语言经验。希望一个例子会更容易理解我的困惑。

root@freebsd1:/usr/home/arun/go-start/src/test2 # go mod init f1/f2/f3/f4/f5/hello
go: creating new go.mod: module f1/f2/f3/f4/f5/hello
root@freebsd1:/usr/home/arun/go-start/src/test2 #
Run Code Online (Sandbox Code Playgroud)

上面的例子go mod init是创建所有这些文件夹(f1/f2/f3/f4/f5/hello)?。我搜索了很多,在系统中找不到任何这样的文件夹。那么这条路的意义何在。

即使未按原样提及此路径,以下命令也不会运行

# go install f1/f2/f3/f4/f5/hello
Run Code Online (Sandbox Code Playgroud)

- :编辑: -

可能这会在以后对某人有所帮助(只需按照步骤以正确的方式理解这一点,尤其是对于新手)

  1. 我打算创建一个程序“计算器”,稍后将上传到 GitHub。

  2. 我将保持功能就像不同的包summultiply等等

  3. 第一步#go mod init github.com/go-arun/calculator(不要在这里混淆,这只是一个假设,将来我可能会在 github 中为此项目创建一个存储库)

  4. created 文件夹sum(包文件夹之一,在sum.go里面创建)

按系统查看:

1.

root@debian1:/home/arun/lab# go mod init github.com/go-arun/calculator
go: creating new go.mod: module github.com/go-arun/calculator

root@debian1:/home/arun/lab# cat go.mod
module github.com/go-arun/calculator

go 1.15
Run Code Online (Sandbox Code Playgroud)

2.

root@debian1:/home/arun/lab# cat …
Run Code Online (Sandbox Code Playgroud)

go go-modules

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

为什么在 Golang 中发送大于缓冲通道大小的值会导致死锁错误?

// By default channels are _unbuffered_, meaning that they
// will only accept sends (`chan <-`) if there is a
// corresponding receive (`<- chan`) ready to receive the
// sent value. _Buffered channels_ accept a limited
// number of  values without a corresponding receiver for
// those values.

package main

import "fmt"

func main() {

    // Here we `make` a channel of strings buffering up to
    // 2 values.
    messages := make(chan string, 2)

    // Because this channel is …
Run Code Online (Sandbox Code Playgroud)

channel go goroutine

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