bash: /src/github.com/tomnomnom/gf/gf-completion.bash: No such file or directory
JordRoest opened this issue ยท 16 comments
root@kali:~# source ~/.bashrc
bash: /src/github.com/tomnomnom/gf/gf-completion.bash: No such file or directory
bash: /src/github.com/tomnomnom/gf/gf-completion.bash: No such file or directory
bash: /src/github.com/tomnomnom/gf/gf-completion.bash: No such file or directory
bash: /src/github.com/tomnomnom/gf/gf-completion.bash: No such file or directory
@kalihackerCD43
your path for completion.bash is wrong!
it should be something like this:
/root/go/src/github.com/tomnomnom/gf/gf-completion.bash
where /root/go is your $GOPATH (it can be different in your case)
happy hacking!
Thanks @unstabl3 ! its work, but if I open a new terminal than i get this:
bash: /src/github.com/tomnomnom/gf/gf-completion.bash: No such file or directory bash: /src/github.com/tomnomnom/gf/gf-completion.bash: No such file or directory bash: /src/github.com/tomnomnom/gf/gf-completion.bash: No such file or directory bash: /src/github.com/tomnomnom/gf/gf-completion.bash: No such file or directory
How can i fix this?
@kalihackerCD43, first of all, it would be good if you give some more details.
it looks like you are exporting it multiple times which you should not!
From the above errors, I can only tell you that you are not exporting "completion bash" with $GOPATH.
Also, read my previous comment again! (if you have used "go get" command to install you can find it under /root/go/...)
have a nice day!
@kalihackerCD43
All my previous comments are good enough to solve this issue..
hi iam also getting same problem i dont know why
Hi,
This happened because your $GOPATH is not set!
two simple fixes for this
- Set your GOPATH
- and/or add the following line in your /root/.bashrc file
source /root/go/src/github.com/tomnomnom/gf/gf-completion.bash
ps: either add or replace your command with the above command.
I hope this will help!
-shubham
echo 'source /root/go/src/github.com/tomnomnom/gf/gf-completion.bash' >> ~/.bashrc
solved
echo 'source $GOPATH/root/go/src/github.com/tomnomnom/gf/gf-completion.bash' >> ~/.bashrc
Sloved
nano .bashrc
add to # like this ( #source $GOPATH/root/go/src/github.com/tomnomnom/gf/gf-completion.bash )
Hello, this worked for me
locate /go/src/ --> /usr/local/go/src/ <=== this is my go/src location
and i added this to my .bashrc : source /usr/local/go/src/gf/gf-completion.bash
After that you have to create directory ".gf" in home and then copy the patterns
Works in Ubuntu 20.04
For new version go:
go install -v github.com/tomnomnom/gf@latest
updatedb
locate gf-completion.bash
Get the real path
and then change the path of gf-completion.bash
in ~/.bashrc
For new version go:
go install -v github.com/tomnomnom/gf@latest updatedb locate gf-completion.bashGet the real path and then change the path of
gf-completion.bash
in ~/.bashrc
thx this really helped
1. Open the .bashrc or .bash_profile file:
nano ~/.bashrc or nano ~/.bash_profile
2.Locate the problematic lines:
source /home/ubuntu/go/src/github.com/tomnomnom/gf/gf-completion.bash
source /home/ubuntu/go/root/go/src/github.com/tomnomnom/gf/gf-completion.bash
3. Comment out or remove the lines: You can comment out these lines by adding a # at the beginning:
# source /home/ubuntu/go/src/github.com/tomnomnom/gf/gf-completion.bash
# source /home/ubuntu/go/root/go/src/github.com/tomnomnom/gf/gf-completion.bash
4. Save and exit:
If you're using nano, save and exit by pressing CTRL + X, then Y to confirm, and Enter to save.
5. Reload your shell configuration:
source ~/.bashrc or source ~/.bash_profile
Thankyou
If you encounter the following error after installing a Go package or tool (like MagicRecon or gf):
It typically means that the path to the gf-completion.bash script is incorrect or doesn't exist. Follow the steps below to fix the issue:
1) Locate the gf-completion.bash File:
Use the find command to locate the actual path where the gf-completion.bash file is installed:
find / -name "gf-completion.bash" 2>/dev/null
In most cases, it will be found under the Go module directory, something like:
/home/your-username/go/pkg/mod/github.com/tomnomnom/gf@/gf-completion.bash
2) Update .bashrc
Once you have the correct path, update the .bashrc file to source the correct path:
Open .bashrc with a text editor:
nano ~/.bashrc
Look for the line that sources gf-completion.bash and replace it with the correct path:
source /home/your-username/go/pkg/mod/github.com/tomnomnom/gf@<version>/gf-completion.bash
After saving and exiting the .bashrc file, reload it to apply the changes:
source ~/.bashrc
This guide should help anyone encountering the same issue. Feel free to share this on GitHub for the community!