Hello World under Linux

Source: Internet
Author: User
Tags lenovo

Finally began to learn Linux.

Start with Hello world.

1. View current directory

[Email protected]:~$ pwd
/home/lenovo

2. Create a new test directory

[Email protected]:~$ mkdir Test

3. Enter the test directory

[Email protected]:~$ CD test

4. New Hello Directory

[Email protected]:~/test$ mkdir Hello

5. Go to the Hello directory

[Email protected]:~/test$ cd Hello

6. New HELLO.C

[Email protected]:~/test/hello$ VI hello.c

#include <stdio.h>
int main ()
{
printf ("Hello world!\n");
return 0;
}

7. Compiling hello.c

[Email protected]:~/test/hello$ gcc hello.c-o Hello

8. View the files in the current directory

[Email protected]:~/test/hello$ ls-al
Total 24
Drwxr-xr-x 2 Lenovo Lenovo 4096 2016-10-12 08:00.
Drwxr-xr-x 3 Lenovo Lenovo 4096 2016-10-12 07:55..
-rwxr-xr-x 1 Lenovo Lenovo 8298 2016-10-12
-rw-r--r--1 Lenovo 2016-10-12 07:59 hello.c

9. Execute the generated Hello program

[Email protected]:~/test/hello$./hello
Hello world!

Done!

The 6th step needs to understand the simple operation method of VI.

Hello World under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.