User management, authority management

Ln create shortcut keys (called shortcut keys in the window system, soft connection file in Linux )

Syntax: ln –s file name 1 file name 2 (create a new shortcut key can not have the same name), as shown in the figure:

 ll view all files

 

Detailed user management:

 

authority management:

ll means   view all content

File execution permissions

 

 

 

Give root permission, other users do not have permission:

Current environment         

The root user created / data / file

        root.root

problem:     

admin-a Failed when normal user wants to execute / data / file

demand:

        Ordinary users want to execute root user files

analysis:

        File-no execute permission

        User-The root user only has write and read permissions

                   admin-a is an ordinary user             

Program:

        1. Let the root user have execute permission first

                chmod +x /data/file

        2. The other user who closed the file does not have execute permission

                chmod ox / data / file

        3. Root test

                /data/file

        4. Change the user permissions of the file

                chown -R admin-a.admin-a /data

        5. Ordinary user admin-a to test

                su - admin-a

                data/file   

to sum up:

        File operation permissions: rwx

        File permissions operation mode: +-=

        File user permissions: ugo

 

        Command knowledge:

                File permission operations:

                        chmod [user symbol] [operation symbol] [operation authority] file

                        For example: chmod ox / data / file

                File user attribution:

                        chown -R [owner] [array] directory

                        例如:chown -R admin-a.admin-a /data

 

Find:

find path-name 'file name (can have regular symbols)'

 

 

Pipe symbol

Command 1 | Command 2

        All content after the execution of command 1 is passed to command 2 through the pipe character

grep filtering

        grep keyword

                Format 1:  

                Command 1 | grep command 2

                Format 2:

                grep keyword file name

                -v negate

                -n When getting content, display line number

 

 

Published 29 original articles · Like1 · Visits 578

Guess you like

Origin blog.csdn.net/wennie11/article/details/105266562