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