Linux programming notes

Source: Internet
Author: User
Tags gz file

1. "/bin", "/sbin", "/usr/bin", "/usr/sbin", "/usr/local/bin", and other paths are already in the system environment variables. now, if the executable file is in these standard locations, enter the file name and parameters of the executable file in the terminal command line, and press Enter.

2. If the file name is not in the standard position, add the complete path before the file name. However, it is too troublesome to run like this every time. A "once and for all" method is to add this path to the environment variable. The command "Path = $ path: path" can add this path to the environment variable, but exit this command line will become invalid. To take effect permanently, add this line to the environment variable file. "/etc/profile" is valid for all users in the system. bash_profile "is only valid for this user

3. perform three steps to install the original code program:
1./configure is used to detect the target features of your Installation Platform
2. Make reads commands from makefile and compiles the project.
3 make install read commands from makefile to the specified location

4. The source command is also called the "dot command", that is, a dot symbol (.). The source command is usually used to re-execute the modified initialization file to make it take effect immediately without logging out and logging on again.
Usage: Source filename or. filename

5. In the Linux File
. So is the shared library
. A is a static library
. LA is a shared library automatically generated by libtool.
The code of the static library is connected to the application developed by the developer during compilation, while the shared library is loaded only when the program starts to run. during compilation, just specify the library function to be used

6. The directory of the Linux library file is/lib/usr/lib.
The directory containing the file is/usr/include/usr/local/include.

7. Files edited by windows may not match the line terminator in Linux. You can use set fileformat = UNIX to save the files in VI.

8. In Linux, line breaks must be added when printf is used for printing. Otherwise, it is easy to be masked by the prompt.

9. If the header file used in Linux is the library header file, it does not need to be written during compilation (GCC or G ++ ).
Usage: if the system usr/include directory is used, use <> include, and then add the-I option to the compiler in makefile.

10.for The. ZIP file in linuxlinux, unzip the unzippressed. tar.gz file with tar-zxvf and use tar-zcvf to compress the folder.

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.