S
S
sergeimvc2020-03-01 03:03:43
linux
sergeimvc, 2020-03-01 03:03:43

What could the strange behavior in the console mean?

Hi all.
When I enter the command "cp file1 file2" I get the error "sh: /usr/bin/cp: No such file or directory" while the file is /usr/bin/cp and file1 (in the directory where I call the command from).
And this applies to all commands (for example, "ls", "mv", etc.).
And this despite the fact that /usr/bin/ls and /usr/bin/mv also exist.
As I guess, the error means that the required binary is not in the /usr/bin directory, but it is, why then the error?

And I noticed a funny fact.
When I enter a command that does not have a binary (for example qwerty) then instead of getting the error described above, I already get "sh: qwerty: inaccessible or not found".

What could it be?

Thank you all in advance for your replies.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
SOTVM, 2020-03-01
@sotvm

Check
/bin/echo $PATH

K
Karpion, 2020-03-01
@Karpion

It looks like you have aliases set in your shell. Do you know what it is?

S
Saboteur, 2020-03-03
@saboteur_kiev

I think that they removed critical libraries that are dependent on ls and other core-utils.
Remember if you removed some files from /lib, or didn't upgrade any packages that most likely failed during the upgrade.
run if it
works ldd /usr/bin/ls
will show dependencies that are not there.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question