./main
zsh: no such file or directory: ./main
If you are trying to run a Rust Language program on your Terminal and you get "no such file or directory", well there could be two reasons for this error,
- You have not compiled your program yet, hence the complied file is not yet created. You can compile your Rust Program file as follows,
rustc <file-name.rs>
- If you think you have completed your file, then make sure that file exists at the location you are running it. Do a dir or ls command in the Terminal/Command Prompt to check based on your Operating System (Windows or Mac/Linux respectively).
ls -ltrh total 824 -rw-r--r--@ 1 c2ctech staff 43B Jul 18 07:10 main.rs -rwxr-xr-x 1 c2ctech staff 407K Jul 18 07:49 main

-
Facing issues? Have Questions? Post them here! I am happy to answer!
More Posts related to Rust,
- Rust: Cargo Init vs Cargo New Command
- Rust: Write and Run Hello World! Program Example
- How to Split a String using Rust Language
- How to Sort a Vector in Rust with Examples
- Fix: error: could not find `Cargo.toml` in Users or any parent directory
- How to uninstall Rust Language from Mac/Linux/Ubuntu
- How to update Cargo (Rust Lang)
- Fix: rust-analyzer failed to discover workspace [Visual Studio Code]
- How to install Rust using rustup on macOS/Linux/Ubuntu
- Cargo Watch: To Recompile Rust Project Automatically
- Difference between rustc and cargo build commands
- How to Split a String by Space in Rust
- How to know Rust is Installed on Mac?
- Rust: zsh: no such file or directory: ./main
- How to update Rust on Mac/Linux
- List of Rust Cargo Commands
- How to find version of Cargo in Rust
- Fix: error: mismatched closing delimiter } [Rust]
More Posts:
- Add Custom header and footer to Windows Notepad file - NotepadPlusPlus
- How to install Java 11 on Mac - Java
- Android : How to make TextView Scrollable - Android
- How to Split a String by Space in Rust - Rust
- Add Custom External Link to SharePoint Site Navigation - SharePoint
- The authenticated user is not authorized to access this resource - Stream/SharePoint/Teams/OneNote - Microsoft
- How to list all versions of Python Modules Available using pip/pip3 - PIP
- Fix SharePoint Error - Unable to Display Named Item - SharePoint