LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 07-16-2009, 03:08 AM   #1
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Rep: Reputation: 30
"bash: /usr/bin/git: No such file or directory " - why does bash look in /usr/bin


Hi
whereis command is unable to find where the program named git is present.
Code:
babu@spanwaveOpensuse:~> whereis git
git:
But typing git on the bash gives me the following ouput
Code:
babu@spanwaveOpensuse:~> git
bash: /usr/bin/git: No such file or directory
Why does bash look in to /usr/bin for git.i have searched for the file named git in the paths specified in PATH env variable.and no special alias is present for git.
Thankyou,
 
Old 07-16-2009, 03:35 AM   #2
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian
Posts: 1,266

Rep: Reputation: 99
It looks in /usr/bin because that is the place of default binaries which is accessible to all users.
 
Old 07-16-2009, 03:46 AM   #3
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
If i type something which is not a command then i get the following output.Why does bash reports the command git is not present in /usr/bin

babu@spanwaveOpensuse:~> sdf
bash: sdf: command not found
 
Old 07-16-2009, 03:49 AM   #4
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,036

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
Can you post the output of this?

Code:
ls -l $(which git)
My guess is that there might be a symlink somewhere in your path pointing to /usr/bin/git, which doesn't exist. That would explain it, I think.
 
Old 07-16-2009, 03:53 AM   #5
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
Here it is

babu@spanwaveOpensuse:~> ls -l $(which git)
which: no git in (:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin)


followed by home dir files.
 
Old 07-16-2009, 03:55 AM   #6
vikas027
Senior Member
 
Registered: May 2007
Location: Sydney
Distribution: RHEL, CentOS, Debian
Posts: 1,266

Rep: Reputation: 99
Quote:
Originally Posted by babu198649 View Post
If i type something which is not a command then i get the following output.Why does bash reports the command git is not present in /usr/bin

babu@spanwaveOpensuse:~> sdf
bash: sdf: command not found
Seems like it is not installed correctly. I recommend you to update or freshen the package.

Paste output of
Code:
find / -name git | xargs ls -ld

Last edited by vikas027; 07-16-2009 at 03:56 AM.
 
Old 07-16-2009, 03:59 AM   #7
babu198649
Member
 
Registered: Oct 2007
Posts: 160

Original Poster
Rep: Reputation: 30
Quote:
Seems like it is not installed correctly. I recommend you to update the package.
Actually i want to uninstall the git.The makefile doesnot support uninstall that is why i used find /usr/local -depth -iname 'git*' -exec rm -rf {} \;

But after this i dont know from where the bash gets to know about git.
 
Old 07-16-2009, 11:06 AM   #8
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,036

Rep: Reputation: 372Reputation: 372Reputation: 372Reputation: 372
Try

Code:
type git
That should tell you what type is. As for the command above, it's clear that it doesn't exist in your path, maybe some alias of function, though it's certainly not a common thing, but your error message above isn't a common thing either.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Zip gives error "-bash: /usr/bin/zip: Argument list too long" konathamsrinu Programming 3 07-06-2006 10:08 AM
bash: /usr/bin/localedef: No such file or directory satimis Linux From Scratch 2 07-28-2005 01:53 AM
Error in man command "sh: line 1: /usr/bin/gtbl: No such file or directory" MinA Slackware 1 09-06-2004 06:36 PM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 02:30 AM
linux command error message bash: /usr/bin/find: No such file or directory sundaram123 Linux - General 8 04-02-2002 07:18 AM


All times are GMT -5. The time now is 12:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration