Embedded linux study notes a - The Basics articles


Linux Operating System Common:
    1.ctrl + Alt + 'T' open terminal
    2.ctrl + shift + '+' to enlarge the font
    3.ctrl + '-' reduced font
    4.ctrl + alt + Enter full screen mode
    5. Click Virtual View window mode machine
      clicks immediately adapt to the client    
    
Linux system basic commands:
    the command [-options] arg1 arg2 arg3 ...
 
    1. terminal command line:
        linux @ Ubuntu: ~ $
        username linux currently logged on
        user classification into two categories :
            1. ordinary users:    
                You can have multiple, can also be a no name no limit
            2. superuser:
                there is only one name for root 
            
            super-user can achieve anything
            ordinary users can only complete the operation within the purview of
            
        ubuntu: operating system name
        ~: current directory of the
            home directory: each user has a home directory, user home directory in any operation
                    Will not be restricted
            Linux
            zhangsan
            lisi
            Wanger 
    
    2. Basic commands:
        1.ls 
          view the current directory of all the files in the
          
          blue file directory
          white ordinary file
          green file has execute permission
          red zip file
         
        2.ls -a 
          view all files in the current directory ( including hidden files)
          hidden files: files beginning.
          
        3.ls -l 
          details view files
            
          file type:
          B: block device file storage block
            file information by the block scan 
          c: character character device file
            in bytes scanning device file information
          d: directory file 
            storage file
          -: normal file
            stores information
          l: Link file link
            links to files in a file
          s: socket file
            used for interprocess communication
          p: pipe file pipe
            is used for interprocess communication
          
          r: have read permission
          w: has write permission
          x: execute permission has 
          no authority ready to use - instead of
          
          the first group rwx:
            user who created the file on a file has permission to read and write the implementation of
          the second group rwx:
            user who created the file on the user's files are in the same group has read and write execute permission
          third group rwx:
            the rest of the file has permission to read and write performed
            
          a hard number of links

          User-created files
          to create a file where the user sets
          
          the file size
          
          file last time a status change of
          
          the file name

        4. Create a file 
          touch file name
            Linux system file names are case sensitive
            Linux file system name space characters are not allowed
        
        5. Delete file
          rm filename
            
        6. Create a folder
          mkdir folder name

        7. Delete the empty folder    
          rmdir folder name

        8. Delete non-empty directory
          rm -rf folder name 

        9. Go to the directory
            of the current directory.
            .. parent directory
        
          cd directory name
          cd .. parent directory enter
          cd into the current directory.
          Cd ~ currently logged into the user's home directory
          cd currently logged into the user's home directory
          cd - return to the previous directory
        
        10. See the absolute path of the current directory
            pwd 
        
        11. the copy files
            cp cp source destination path dir1 / dir2 a.doc shows a file in a.doc copy dir1 to dir2 the
            cp source folder object path -rf 
            
        12. the mobile files
            mv source destination path
            mv source folder destination path
            
            to modify the file name:
                mv old file name new file name
            
    3.Linux system directory structure: cd / into the
        tree structure:
            Many
            
        / root directory: top-level directory
            at the root of the file system are
        
        bin binary executable file storage directory binary
        etc to store configuration files        
        mnt mount the file is stored
        proc process-related documents stored
        boot store boot code
        dev storage device files Device
        lib store library Libary
        var store log files
        
        home storage directory ordinary user's home directory
        root super-user's home directory
        
        Linux -> / home / Linux
        zhangsan -> / home / zhangsan
        lisi -> / home / lisi 
        root -> / root 
        
    absolute path and relative path:
        / home / linux absolute path 
        home / linux relative path
        
        relative path:
            Current different location, different users log in, the same path will have a different meaning
        absolute path:
            Current different location, different users log in, the same path will not produce a different meaning
            
            relative path:
            File
            ./file 
            ../file 
            ~ / File 
            
            zhangsan / Home / zhangsan / file
            lisi / Home / lisi / file
            root / root / file 
        
            absolute path:
            / Home / Linux / Desktop
            / Home / Linux / Desktop / Desktop
        
    exercise:
        use the Linux command implementation creates three folders on the desktop test1 test2 test3 
        and were created at file1.txt test1 
              created at test2 file2.txt
              created at file3.txt Test3 
        
        ~ / Desktop 
        
        1. Go to the desktop folder
            CD ~ / Desktop 
            
        2. Create three folders
            mkdir test2 test1 Test3 
            
        3. files are created in the folder corresponding to
            touch test1 / file1.txt test2 / file2.txt test3  / file3.txt

    5. The document editing:
        Vim editor
            three modes:
                1. The line mode (default entry mode)
                2. Insert mode (writing of information)
                3. The command mode (save and exit)
            
            line mode -> insert mode
                clicking a button i key or the o key
            insert mode -> line mode    
                click ESC to
            line mode -> command mode
                hits:
                                                command mode -> line mode
                                                                click ESC key
                
            : W save 
            and: q
            : wq save and exit
            !: W force save
            : ! q forced to quit
            : wq forced to save and exit!
            
            1.vim filename
              is vim open filename file
            2. Click i Menu, a key, or to enter the insert mode o
            3. Write data
            4. Click ESC to return in the end line mode
            5. Click: wq save and exit
            
    6. Switch Chinese input method:
        1. click the set button in the upper right corner
        2. click on "the setting the System"
        3. click on "Language Support"
        4. Keyboard input method system to the ibus
        5. the click Close 
        6. the restart the virtual machine
        7. implementations space ctrl + English switch
            
================================================ ===========
    Linux systems in C language development steps:
        vim editor
        gcc compiler
        terminal 
        
        the Hello world
        
        1.vim filename.c 
        2. click the i button
        3. programming
            #include <stdio.h>
            
            int main (void)
            {
                the printf ( "Hello World");
                
                return 0;
            }
        4. Click the ESC key
        5. Click: WQ 
        6. The GCC compiler, filename.c //
        7. ./a.out // run
            
        GNU organization
            vim gcc the make ..
            Linux
            LAMP
            
            Linux operating system kernel,
            the Apache Web server
            MySql
            Python

        C-32 keyword
        
        printf

Released five original articles · won praise 0 · Views 115

Guess you like

Origin blog.csdn.net/qq_42930154/article/details/104563469