For Beginners---linux usage instructions

Source: Internet
Author: User
Tags vm virtualbox

2018 Noip Shanghai Division can use the Windows operating system dream is still shattered!!!!
most of Shanghai's NOIP players have started to change Linux ...
Well, let's take a look at the Linux operating system today, what Noip players should know.
----------------------------------------------------------------------------------------------------------- ------------------------------
Linux Operating system advantages:
The system allows the user to directly manipulate the system terminal to carry out a series of commands, such as: Accessing data on the hard disk, creating a file (VIM), compiling the program, debugging the Program (GDB)
----------------------------------------------------------------------------------------------------------- ------------------------------
Linux operating system download and installation:
1, you can choose to buy MAC system directly Apple Computer (Apple Computer is actually Linux architecture, and Linux is not much different)
2, can download NOI official website (www.noi.cn) official online Linux system, and then the next virtual machine (recommended: VM VirtualBox)
----------------------------------------------------------------------------------------------------------- ------------------------------
Linux OS terminal:
* * * HINT: "_" stands for space   
* * * HINT: All of the following commands are entered under terminal
1. Enter the terminal:
(1) virtual machines or Linux operating systems under Windows:
shortcut keys: ctrl+alt+t or terminal in the upper right corner of the screen "applications", "Accessories"
(2) Apple system:
Finder---finder, utilities--application---terminal
2. Download VIM, GDB
the commands are: sudo_apt-get_install_vim
Sudo_apt-get_install_gdb
3, several basic operations:
(1) Create a folder: mkdir_+ (the name of the folder you want to create) such as: Mkdir_test
(2) Open a folder: cd_ (the file name you want to open) such as: Cd_test
(3) Create a file and enter VIM to write the program: vi_+ (the file name you want to create) such as: Vi_a.cpp
(4) Compile a program: G++_-o_ (the generated executable file name) _ (the file name currently being compiled) _-g such as: G++_-o_a_a.cpp_-g
(5) Execute an executable file: ./(The executable file name you want to run) such as:./ A (note:/previous point . )
4. Write code using VIM:
(1) Write code: i (Note: Every entry must be played, otherwise you can not write)
(2) Exit VIM: <1> Press ESC <2> keyboard to write : Wq (Note: " : " not missing)
5. Use GDB Debug Program:
(1) entering GDB: gdb
(2) Specify the executable file you want to debug: file_ (executable to debug) such as: File_a
(3) Displays the code under the executable file: list or l (note: English alphabet)
(4) Set breakpoint: Break_ (line number of breakpoint) or b_ (line number of breakpoint) such as: B_3
(5) Run Program: Run or R (note: English alphabet)
(6) Continue to execute the program until a breakpoint or end program is encountered: continue or C (note: English alphabet)
(7) Execute the next line of code: next or n (remark: English letter)
(8) Exit GDB: q (note: English alphabet)
----------------------------------------------------------------------------------------------------------- ------------------------------
OK, the rest will be handed to you to tinker, the most important is here ....

For Beginners---linux usage instructions

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.