How Do You Write a “Hello World” Command in Rust?

Problem scenario
You want to write a basic program in Rust to know you have it installed correctly. What do you do?


  1. Install Rust. If you need assistance, try this command:
sudo curl --proto '=https' --tlsv1.2 -sSf | sh

2. Create a file called with the following four lines:

// We recommend calling this
fn main() {
    println!("Hello World!");
  1. Compile it with this command: rustc
  2. Run the bytecode by using this command: ./contint

Leave a comment

Your email address will not be published. Required fields are marked *