我想一个例子可以很好地理解我的问题.
...
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开头的所有命令来选择合适的命令吗?
我安装minikube在Windows 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) 只需 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)
- :编辑: -
可能这会在以后对某人有所帮助(只需按照步骤以正确的方式理解这一点,尤其是对于新手)
我打算创建一个程序“计算器”,稍后将上传到 GitHub。
我将保持功能就像不同的包sum,multiply等等
第一步#go mod init github.com/go-arun/calculator(不要在这里混淆,这只是一个假设,将来我可能会在 github 中为此项目创建一个存储库)
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) // 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) go ×2
bash ×1
channel ×1
command-line ×1
go-modules ×1
goroutine ×1
kubectl ×1
kubernetes ×1
linux ×1
minikube ×1
windows-10 ×1