Find files quickly in Linux system

Sometimes download new files or install new packages

But I can't figure out which directory it is placed in by default. At this time, you can use the locate command to perform a fast fuzzy search.

For example I use

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

When I install the bolt command on a host without the GOPATH environment variable, I don't know where it is by default. I just need to execute the following command to search for the location of the bolt

updatedb
locate bolt

will have similar output

/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

You can see that the go get command automatically created the /root/go directory and placed the pulled package under src/github.com

It'll be easier to find

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324968500&siteId=291194637