How Do You Write Code in Linux?
Contents

How do I write code in Linux?

How to Write C Program in Ubuntu

  1. Open a text editor (gedit, VI). Command: gedit prog.c.
  2. Write a C program. Example: #include<stdio.h> int main(){ printf(“Hello”); return 0;}
  3. Save C program with .c extension. Example: prog.c.
  4. Compile C program. Command: gcc prog.c -o prog.
  5. Run/ Execute. Command: ./prog.

How do I run a program in Linux?

To run a Linux program on Windows, you have these options:

  1. Run the program as-is on the Windows Subsystem for Linux (WSL). …
  2. Run the program as-is in a Linux virtual machine or Docker container, either on your local machine or on Azure.
Sophia Al-Mansoor

Sophia Al-Mansoor

Global Business & E-Commerce Reporter

Sophia analyzes international trade, startup ecosystems, retail transformation, and supply chain logistics for modern digital publications.

Share this article
Twitter Facebook Pinterest