Such files or directory linux

No such file or directory? But the file exists!

I’ve downloaded a game (Shank) but the bin file doesn’t run. The error that is shown when I try to launch the executable is:

bash: ./shank-linux-120720110-1-bin: No such file or directory 

Thank you for your reply. I’ve done the command you said Agent86 but I have the same result. I’ve downloaded also the .deb file but there is a problem too. I don’t know what problem has this game.

Please confirm whether you’re running a 64-bit installation (that’s the most common case for this problem).

9 Answers 9

You’re probably trying to run a 32-bit binary on a 64-bit system that doesn’t have 32-bit support installed.

There are three cases where you can get the message “No such file or directory”:

  • The file doesn’t exist. I presume you’ve checked that the file does exist (perhaps because the shell completes it).
  • There is a file by that name, but it’s a dangling symbolic link.
  • The file exists, and you can even read it (for example, the command file shank-linux-120720110-1-bin displays something like “ELF 32-bit LSB executable …”), and yet when you try to execute it you’re told that the file doesn’t exist.

The error message in this last case is admittedly confusing. What it’s telling you is that a key component of the runtime environment necessary to run the program is missing. Unfortunately, the channel through which the error is reported only has room for the error code and not for this extra information that it’s really the runtime environment that’s to blame. If you want the technical version of this explanation, read Getting “Not found” message when running a 32-bit binary on a 64-bit system.

The file command will tell you just what this binary is. With a few exceptions, you can only run a binary for the processor architecture that your release of Ubuntu is for. The main exception is that you can run 32-bit (x86, a.k.a. IA32) binaries on 64-bit (amd64, a.k.a. x86_64) systems.

Читайте также:  Linux где находятся драйвера

In Ubuntu up to 11.04, to run a 32-bit binary on a 64-bit installation, you need to install the ia32-libs package . You may need to install additional libraries (you’ll get an explicit error message if you do).

Since 11.10 (oneiric) introduced multiarch support, you can still install ia32-libs , but you can choose a finer-grained approach, it’s enough to get libc6-i386 (plus any other necessary library).

Источник

How to Fix “bash: no such file or directory”

Unlike other operating systems such as Windows, Linux is an OS in which the majority of its tasks are performed using the Terminal. One of the major tasks that the Linux terminal performs is the execution of programs using commands. While attempting to execute any program through this method, the user may come across this very common error statement which is the “no such file or directory” issue.

This article will elaborate on the reasons that prompt the error “no such file or directory” and also provide possible solutions to fix it

How to Resolve the “no such file or directory”?

Since this is a very general error, there are a few different reasons that can invoke this issue on the system. All these reasons are discussed below in great detail.

Reason 1: Wrong File Name

The first and the most commonly occurring reason is caused by using incorrect spellings of the file name. For example, the mistake can be the incorrect spelling of a file. Below is an example of such a mistake:

Solution: Check the File name and Path

In the example shown above, the bash file “sample.sh” is saved on the desktop. So, make sure that the error is not invoked by using the correct spellings and the correct path. Look at the following image where the name and path of the file are correct, and thus, the output is displayed:

Reason 2: Wrong File Format

The other most common cause behind this issue is that the file that is attempted to execute is in a different format than the operating system. Let’s take an example of this situation. The file that is executed using the command is a DOS file which is a script written for Windows. If this DOS file is executed in an Ubuntu system, the “no such file or directory” issue will be invoked.

Читайте также:  Linux mount smb cifs

Solution: Use the dos2unix Tool

There exists a very useful tool for exactly these types of scenarios. The dos2unix tool helps to convert a dos file to a script that can be read by the Ubuntu OS. The first step is to install the dos2unix tool using this command:

$ sudo apt install dos2unix

Once the tool is installed, convert the DOS file into an Ubuntu-compatible file using the following command:

The system should be able to run the script file without the error being prompted after the conversion is complete.

Conclusion

The “no such file or directory” issue occurs when the name or the path of the executable file is entered incorrectly into the terminal. Another reason is that Ubuntu is not able to read the DOS script and if it is executed on the Ubuntu terminal, then the error is prompted. To fix these issues it needs to be made sure that the file path and file name are entered correctly into the terminal. The other fix is to install the dos2unix tool and convert the dos files format to run on Ubuntu. This article has demonstrated the reasons and the solutions to fix the error “no such file or directory”.

TUTORIALS ON LINUX, PROGRAMMING & TECHNOLOGY

Источник

«No such file or directory» but it’s there.

As you can see from the above I’m trying to go to the folder brian2 but Ubuntu tells me No such file or directory but the directory list command tells me it is there.

2 Answers 2

From home to enter brian2 from /home/ , type in terminal

When to say cd /brian2 , it tries to navigate the folder at / but there is no folder brian2

Further Clarification as you asked in your comment

Christian Mann aptly said it, tilde ~ refers the same thing as /home/brian2 in your case.

~ refers to home for any user. For example,

For brian ~ refers to /home/brian

For brian1 ~ refers to /home/brian1 so on.

If brian1 enters to brian’s home (have to have permission) he will see at prompt

In Linux always you can modify things. There is a special shell variable PS1 which can modify the shell prompt in different ways as you wish.

Читайте также:  Как отключить ввод пароля линукс

Just to clarify, the point is that / refers to the very top of the hierarchy of your system. home is a top-level directory under / so /home refers to the home directory at the top of the hierarchy and /home/brian2 refers to the brian2 directory inside the home directory, whereas /brian2 refers to the non-existent brian2 directory at the top of the hierarchy. cd can also check the current directory, so if you are in /home already, it will go to /home/brian2 if you type cd brian2 . cd /home/brian2 does the same thing.

I would have thought it would have brought me to . brian2@ubuntu:/home/brian2$ ?? Thanks for your patience! Brian

@brian If this answer has answered your question please accept it to help keep our site clean and orderly. Thanks!

Источник

bash: cd: : No such file or directory [duplicate]

enter image description here

I upgraded to the latest version of Kali Linux and all of a sudden I can’t open up files. The file manager shows the files exist and I can get in them through the file manager but cannot do so through the CL.

Fair response @ikkachu. I’ve deleted my comments as they no longer have context as they were in response to a user that has since deleted their comments. A basic tutorial would have likely resolved the user’s problem. I was basically protesting the closing of this question under the Kali Linux duplicate go-to.

2 Answers 2

First of all / is a directory, so if you use: cd /something it means that change to directory something which is inside / directory.

You are in /opt directory and you are having three directories there:

Teeth Veil Pycharm-community-2018.3.4 

Now if you want to enter in any of these directories, you should use command:

Not cd /directory_name because it will change to directory_name in / .

And same for the Downloads and Desktop directories. If you are in the home directory then try to use:

Not cd /Desktop.

Not cd /Desktop as you have it.

Explanation

The issue that you’re having is that you are trying to go to an absolute path rather than a relative path. You should research these terms and understand the significance of placing a / at the beginning of your path. Basically, absolute paths start from the root directory (what you were trying to use), and relative paths start from the working directory of your shell.

Источник

Оцените статью
Adblock
detector