Getting started with project development Linux

Source: Internet
Author: User
As the saying goes, it will sooner or later be paid back. The Linux account owed by the university should be paid back now. I have finished studying Linux in college, and I have never touched it again. I have handed it back to my old

As the saying goes, it will sooner or later be paid back. The Linux account owed by the university should be paid back now. After I finished studying Linux in college, I almost never touched it again. I have handed it all back to my teacher. Now we have to start learning again.

In project development, it is relatively simple to start with Linux development. you don't need to know much about it. you can familiarize yourself with basic command mode operations and common vim editor operations. To a certain extent, we will learn more about Linux based on different requirements.

It was not easy to get started with SecureCRT, because I did not know what it was, and later I learned that it was a remote logon to Linux. After searching some related commands, I started to operate and installed vim. after so long, I forgot how vim was installed. Sadly, however, people around you are all resources that can be used, so don't waste so many big cows around you. Then, I watched Daniel's demo and started to operate it myself. I was also familiar with some Linux and vim command operations.

At this stage, it is okay to be familiar with some basic concepts and master some basic command operations. Based on my own experience, root-related operations can be ignored first, this saves a lot of energy. This is what we know:

1. understand Linux Directory configuration

Run the cd/command to enter the root directory and view all the files in the directory. many folders are displayed, which are arranged according to the FHS standard, the corresponding software is stored in the corresponding directory, because there are many Linux versions.

Signature + signature/Signature/signature + a3xdbDtcTKx7 + qu/q74dPDtb21xL/iuq/K/fingerprint + signature/CvM/CoaM8L3A + signature/Jyb6z/bXEyeixuKOsz/ signature + signature + t8XWw7XEo6zE47/signature + ahozwvcD4KPHA + signature/s + signature/Signature/s7xy/signature + 3cS/wryhozwvcD4KPHA + signature + region + ICAgICAgICC/region + Region + region/region + Region + o6y + zbvhv7S8 + Region + region/region + region/u0 + region/D5rXEtrzKx2SjrGS0 + rHttcTKx8S/region + examples/examples + wO/examples + a1xNfWt/u0 + examples/I/examples/JtsGjrHe0 + examples/evs3Kx9fWt/examples + y/nT0NXftcTIqM/ eo6y12rb + 1 + nOqs2s1 + nTw7untcTIqM/eo6y12sj91 + records + zsS8/rXEy/keys + m1xM/Wz/keys + 8jD1 + nN4rXEyMu/keys + records + keys/keys + w/ authorization/authorization + rHttcTV4rj2zsS8/rXEy/authorization + tcTL + authorization + tcTI3cG/expires + 69/expires + ICAgICAgICC12sbfwdC0 + expires/expires + expires/ybbBtcTIqM/ examples/examples/CvLXEzsS8/examples + examples/examples + zb/examples/bjDzsS8/qOsyOe5 + 7bU0ru49sS/examples/rvyxL/CvKOsyb6z/ bytes + u/keys/wrzE2rXEzsS8/rvuxL/keys + zb/keys/eo6zEx8O0vs2/keys/cvlpjz1_pnf3xl/CvKGj1eK49r/keys/ examples/MHuoaM8L3A + examples + ipv6o/1NpMaW51eM/examples + examples/yda00NC1xKGjscjI59G5y/XOxLz + o6zAqdW5w/examples + examples" http://www.2cto.com/uploadfile/Collfiles/20140302/2014030209550533.jpg "Alt =" \ ">

3. Master common Linux Commands

There are too many commands in Linux. At present, you only need to master some common commands in the entry stage.

The most commonly used commands are ls and cd. ls is the command used to list all files in a folder. of course, you can configure parameters, here,-a and-l are used in many ways.-a indicates to list hidden files, and-l indicates to list detailed information of files. of course, the two parameters can be used at the same time, for example, both ls-al and ls-a-l can be used to achieve the combination of the two. The cd command is used to enter a specific directory, and the cd .. command is used to return to a level-1 Directory. cd/is used to enter the root directory, cd ~ Name indicates to enter a specific directory under the/home directory. if you do not enter name, it indicates to enter your home directory. this involves the problem of relative paths and absolute paths, /starts with an absolute path. for example, cd/home/tengpeng indicates entering my main folder, and/home/tengpeng indicates an absolute path. if it is in my main folder, cd c ++/learn: Enter the learn folder under my c ++ folder, where c ++/learn is the relative path.

Of course, the most file operations are performed during the development process. this involves file creation, deletion, movement, and replication.

Run the touch name command to create a file and create different folders. if mkdir name is used to create a folder named test1, create a folder named test2 in test1, and create a folder named test3 in test2, in addition to creating a directory one by one, there is also a kind of recursive creation, mkdir-p test1/test2/test3, this-p parameter is particularly important, if not, the creation fails. Since the Linux extension is useless, why do we still need to write it when creating a file? for example, if we create a c ++ file, we will write hello. h or hello. cpp, I asked someone else, saying that it is to let others know what file you are, which is equivalent to an identifier, or that software written by someone else may only allow file execution with a certain extension.

The command for deleting a file is rm name. if it is to delete a directory, if it is empty, it is rmdir name, if it is not empty, recursively delete all files and folders in the directory as rm-r name, and-r is a parameter, if you delete test1/test2/test3 created above, you can run the rmdir-p test1/test2/test3 command if there are no other files in the three folders.

The command for moving a file is mv name1 name2. name1 is the original name of the file, and name2 is the name after the change. why is the name changed, because this command can also be used to change the file name, such as setting hello. change h to hello. cpp is mv hello. h hello. cpp, so move it. if I want to put hello. h. move to the c ++ directory and run the following command: mv hello. h c ++/hello. h or mv hello. h/home/tengpeng/c ++/hello. h. there is a path problem.

Copying a file is similar to moving it. the command cp name1 name2 also has a path problem like mv. Cp has permission issues because the copied file owner is the operator itself.

You can also run the command cat name, tac name nl, more, less, head, and tail to view the content of a file. you can try the command to see the effect. you can also add parameters to achieve different effects.

Of course, there are also file searches, such as which, whereis, locate, and find.

If a command does not know how to use it, it is helpful, man page and info page. if you do not know how to use the ls command, how to add parameters, as long as the input man ls or info ls is used to find the corresponding usage, we can use it according to the found usage to achieve our goal. The above are some common commands. of course, after learning for a while, we will continue to learn more commands. as long as we use more commands, we will be very skilled. By the way, we also have the tab key, this is a frequently used completion shortcut. for example, I want to enter the/home/tengpeng/c ++ directory, as long as you enter cd/h + tab +/t + tab +/c + tab, if you press the tab and it does not respond, it means that the conditions you have given are not very accurate, for example, if you have a c ++ file and a c # file, you cannot complete the c file by pressing the tab key, because it does not know whether you want c ++ or c #, of course, if you press it twice in a row, you will be pleasantly surprised.

4. master the common commands and functions of the vim editor.

Vim is a very classic and useful editor. although it cannot be completed during editing (or it is quite troublesome to complete ), however, after using it for a while, I think it is a very useful editor. I like it very much and feel much better than eclipse. I take the initiative to identify the accuracy of the syntax with the font color to facilitate programming. Of course, this is also a command mode operation, so there will be a lot of commands. The following describes the common commands used in programming.

Vim has three modes: General mode, edit mode, and command line mode. Generally, the mode enters the edit mode by I (I), o (O), a (), r (R) key. in the editing mode, press Esc in the general mode. you can only switch from the general mode to the command line mode. use :,/,? These three symbols are also the Esc key. To exit the editor in normal mode, use w (save), q (exit), and wq (save and exit ).

When writing code, we often need a lot of operations to improve the speed and quality of code writing. This requires a lot of commands to implement it, and we will naturally be very skilled in using it.


Of course, there are some related functions. if you want to copy part of a file and paste it into another file, you need to use multi-file editing. if you write a file, if you need another file for reference, you can open another window, but it is a waste of time to manually switch the window. This requires multiple window functions.

Let's take a look at the multi-file editing function. when you enter vim test. h test. in this way, you can edit multiple files by using the command: n,: N to switch files, and the copied content of one file can be used in another file.

Let's look at the multi-window function. when we use vim test. run the command: sp test. h. h. in the lower part of the window, if no name is added, a copy of the file being edited is displayed below. to switch between the two files, use ctrl + j (ctrl + ←) or ctrl + k (ctrl + ← ).

The threshold for Linux is gradually increasing.

Related Article

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.