Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-10-2011, 02:10 PM   #1
LQ Newbie
Registered: Mar 2011
Posts: 2

Rep: Reputation: 0
bash:lex:command not found..

Can somebody please tell me what does error message signify and what should be done to rectify it...
Old 03-10-2011, 02:33 PM   #2
LQ Guru
Registered: Apr 2005
Posts: 5,818

Rep: Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004Reputation: 1004
Can you tell me how you are getting this error? What are you exactly doing to get this?
Old 03-10-2011, 02:35 PM   #3
LQ Veteran
Registered: Nov 2002
Location: Somewhere inside 9.9 million sq. km. Canada
Distribution: Slackware 14.1, 14.2
Posts: 5,306

Rep: Reputation: 574Reputation: 574Reputation: 574Reputation: 574Reputation: 574Reputation: 574
"Command not found" means the command you tried to run was not found in your path. The path is the directories the system will look through to find the command code, or program, you are asking it to execute. Here is an example, I'll use the command lsusb to illustrate the 'how to fix' part.

bash: lsusb: command not found
I ran the command lsusb, and got 'command not found'.

Next, i ran the command 'locate' to find the command code.

locate lsusb
I get two things, the first is the binary code, the second is the man page for the command.

Now I try it again, this time I supply the path to the binary.

Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 04f9:0028 Brother Industries, Ltd Printer
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
This time it runs. I get the expected output.

To find out what your path is, at a command prompt, type 'echo $PATH' without the quotes. The system will print out to your screen ( standard out ) the value stored for path.

Here is mine.

echo $PATH
If you look through the output, /usr/sbin/ is not listed. So the system gave me 'command not found'. It worked when I told it where to look.
Old 03-10-2011, 03:39 PM   #4
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2018 CentOS6.10 CentOS7.5 + 50+ other Linux OS, for test only.
Posts: 17,125

Rep: Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491Reputation: 3491
.. lex:command not found ..
Probably install the package 'flex'.

"flex" will provide /usr/bin/lex

Please read 'LQ Rules'
> > You have a duplicate thread


Last edited by knudfl; 03-10-2011 at 03:45 PM.


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
lex command not found vincis8 Linux - Newbie 1 10-07-2008 02:37 AM
Cygwin problem: lex: Command not found EasyLife Linux - Distributions 1 07-28-2008 11:19 AM
lex: command not found PankajDS Linux - General 5 02-14-2008 04:03 PM
bash: rpm: command not found && sudo: alien: command not found Java_Code Ubuntu 7 07-28-2006 12:57 AM
Compiing php 5 Lex: command not found 1kyle SUSE / openSUSE 1 03-27-2006 08:47 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:14 PM.

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