Linux系统快速查找文件

有时候下载新的文件或安装新的包

但是却搞不清默认放在哪个目录了,这个时候可以使用locate命令进行快速模糊查找

比如我使用

go get github.com/coreos/bbolt/...

在一台没有配置GOPATH环境变量的主机上安装bolt命令的时候不清楚默认放在什么位置了,我只要执行如下命令就可以搜索到bolt的位置

updatedb
locate bolt

会有类似输出

/root/go/src/github.com/coreos/bbolt/.git/refs/heads
/root/go/src/github.com/coreos/bbolt/.git/refs/remotes
/root/go/src/github.com/coreos/bbolt/.git/refs/tags
/root/go/src/github.com/coreos/bbolt/.git/refs/heads/master
/root/go/src/github.com/coreos/bbolt/.git/refs/remotes/origin
/root/go/src/github.com/coreos/bbolt/.git/refs/remotes/origin/HEAD
/root/go/src/github.com/coreos/bbolt/cmd/bolt
/root/go/src/github.com/coreos/bbolt/cmd/bolt/main.go
/root/go/src/github.com/coreos/bbolt/cmd/bolt/main_test.go
/root/xfleet/pkg/linux_amd64/vendor/github.com/coreos/bbolt.a

可以得知go get命令自动创建了/root/go目录并且把拉下来的包放在了src/github.com下面

这样再去找就比较轻松了

猜你喜欢

转载自www.cnblogs.com/ksir16/p/8961319.html