LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-07-2017, 06:17 AM   #1
FoxtrotLima
LQ Newbie
 
Registered: Jun 2017
Posts: 3

Rep: Reputation: Disabled
"Command not found" no matter full path or relative or none yet...


Is there something special about /usr/local/bin.

This happens both with scripts and binary executables.
I can ls, and "which" and "whereis" show me the exe file but when I try to run it says "Command not found". I have done "rehash" and also logged out and back in.

A binary exectuable called for example "sr" gets this:

# sr ls
sr: Command not found.
# ./sr ls
sr: Command not found.
# ls sr
sr
# whereis sr
sr: /usr/local/bin/sr
# which sr
/usr/local/bin/sr
# /usr/local/bin/sr ls
/usr/local/bin/sr: Command not found.

I also made a simple csh script in the same dir, that just echos "this is here" to the screen. it acted normally, where it was "not found" but I could call it with ./ prefix, and after I did a "rehash" could just call it. Also /usr/local/bin is first in my PATH.

Anyone run into this before?
 
Old 07-07-2017, 06:28 AM   #2
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917
Could you please do a:

ls -ld /usr/local/bin/sr

Also, purely to check:

echo $PATH

Just a note that, in your examples, you should show which current working directory you're calling the various commands from.
 
Old 07-07-2017, 06:48 AM   #3
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 16,505

Rep: Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548Reputation: 5548
additionally:
file /usr/local/bin/sr
and
head /usr/local/bin/sr
if that was a readable text file.
 
Old 07-07-2017, 06:48 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,319
Blog Entries: 13

Rep: Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372
Any particular reason you are the root user here?

There is nothing more special about /usr/local/bin than any other directory.

I also would like to see the output of the ls -ld command hydrurga has asked you for and your $PATH variable in support of your comment that /usr/local/bin is in your path.

Seeing the long listing of that file will tell us who owns it, what group it is in, and what the files privileges are.
 
Old 07-07-2017, 07:25 AM   #5
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (current), FreeBSD, Win10, It varies
Posts: 9,952

Rep: Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148Reputation: 2148
yeah I've had this happen to me with something else - it was there but when ever I tried to use it - it'd tell me the same thing, I did the same searches you did seeing it was there then I just got tired of trying to figure out why it would still not work and just reinstalled it. that fixed that problame toot sweet. someone than suggested after I did this to check it with stat. but it was too late by then.

Last edited by BW-userx; 07-07-2017 at 07:27 AM.
 
Old 07-07-2017, 08:54 AM   #6
FoxtrotLima
LQ Newbie
 
Registered: Jun 2017
Posts: 3

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by hydrurga View Post
Could you please do a:

ls -ld /usr/local/bin/sr

Also, purely to check:

echo $PATH

Just a note that, in your examples, you should show which current working directory you're calling the various commands from.
Sorry, I am used to a prompt that does show it but I was in /usr/local/bin.

I was root because there was a need to be for the work I am doing.

I'm on my way out and it is on a different machine that isn't connected to the internet, so please take my word for it, FIRST in my path is (spelled correctly) /usr/local/bin

Besides, it is a moot point. I can see the command. As I said if I call it with full pathname it still doesn't use it. "sr" is a binary executable. I'm having the same thing with scripts as well.
 
Old 07-07-2017, 08:58 AM   #7
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 20 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917Reputation: 2917
Quote:
Originally Posted by FoxtrotLima View Post
Sorry, I am used to a prompt that does show it but I was in /usr/local/bin.

I was root because there was a need to be for the work I am doing.

I'm on my way out and it is on a different machine that isn't connected to the internet, so please take my word for it, FIRST in my path is (spelled correctly) /usr/local/bin

Besides, it is a moot point. I can see the command. As I said if I call it with full pathname it still doesn't use it. "sr" is a binary executable. I'm having the same thing with scripts as well.
With all due respect, you were able to paste (or at least copy) output from that machine before on to this forum.

I and pan64 have both asked you to provide output from various commands in order to troubleshoot. You might also add the stat command implied by BW-userx's post. If you won't help us, we can't help you.
 
Old 07-07-2017, 09:35 AM   #8
rtmistler
Moderator
 
Registered: Mar 2011
Location: USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu, Debian
Posts: 9,319
Blog Entries: 13

Rep: Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372Reputation: 4372
Once again, some important ls -l information would be file ownership and permissions.

It is very common for any or all of us, including yourself, to have something unexplained hit us, and then we have a viola moment where we realize we overlooked something.

Therefore when you have the time to look further into this, perhaps you can check this information.

We do understand that you cited other applications or scripts. Therefore perhaps something changed to the permissions or ownership of the /usr, /usr/local, or /usr/local/bin trees. I would check those as well.
 
1 members found this post helpful.
Old 07-07-2017, 11:06 AM   #9
scasey
LQ Veteran
 
Registered: Feb 2013
Location: Tucson, AZ, USA
Distribution: CentOS 7.8.2003
Posts: 5,425

Rep: Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054Reputation: 2054
*nix systems are intentionally vague about permission errors. They use "file not found" or "command not found" when the user doesn't have permissions, which is why we're asking to see ls -l...it will show us the permissions.

A point of experience: I always use ls -l to look at files. A simple ls tells me nothing about the file other than it appears to be there (it could, for example, be a link to another file that is not executable -- something I'd never know unless I did a long listing)
 
1 members found this post helpful.
Old 07-07-2017, 07:08 PM   #10
frankbell
LQ Guru
 
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 17,412
Blog Entries: 28

Rep: Reputation: 5409Reputation: 5409Reputation: 5409Reputation: 5409Reputation: 5409Reputation: 5409Reputation: 5409Reputation: 5409Reputation: 5409Reputation: 5409Reputation: 5409
Quote:
A binary executable called for example "sr" gets this
Is sr the command or it merely a random string of letters? A web search turns up no reference to an "sr" command.
 
  


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
[SOLVED] Is it allowed to use full path to "*.desktop" files in the "mimeapps.list"? Andy_Crowd Linux - Newbie 1 05-12-2016 03:17 PM
Create a "relative path" tar-archive? wh33t Linux - Newbie 5 09-04-2014 10:28 PM
[SOLVED] "Command not found" for all but pwd and echo, PATH is empty ManiacBlaster Linux - Newbie 5 03-01-2011 11:45 AM
Newbie - OSX "command not found" Path issue Pinball2k Other *NIX 11 10-19-2008 04:00 PM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:05 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration