Linux Foundation One

Source: Internet
Author: User

First, File hidden properties
Lsattr lists the hidden properties of all files in the current directory
-R parameter: Lists the hidden attribute permissions for all file directories in the current directory
-D: Show only hidden attribute permissions for the directory,-D common most commands
Command: chattr parameter filename
+a parameter, the file can only append, can not be any other rename, add or delete, but can be checked
+i parameter, the file cannot be renamed, deleted or modified, but can be checked


Ii. special permissions for files and directories
1, suid only for the command, can not be used for files and directories, for permission issued, such as can only be used by the root user command, chmod u+s, ordinary users can also use the changed command

2, Sgid g+s filename in the directory, ordinary users in this filename to create files, directories, created files and directories belong to the group belonging to the G+s user

3, sticky o+t filename The file created under this directory can only be added or modified by the user who created it, and other users do not have permission to operate and need to chmod 755 permissions.


Third, find command

Find path-type type:-name "123" such as D directory f file
-inum parameter with Indoe value

For example: Find./-mtime +10 View current directory 10 days ago files


四、三个 Time Properties

The Access time,atime of the file is changed when the file is read or executed;

The Modified time,mtime of a file is a change in the contents of the file when it is written;

The file's Create time,ctime is a change in the contents of the Inode as it is written to the file, changes owner, permission, or link settings.

Stat filename View 3 Time properties for this file
Touch directly affects 3 time attributes
Vim modifies content, and 3 time attributes change


Five, hard links and soft connections

Hard Links: Ln a.txt b.txt
Create a.txt hard links named B.txt their inode, block values are the same, a or B is modified, and the other is modified. Hard links do not work on directories, deleting hard links does not affect the original files, and cannot span partitions.
Soft Links: ln-s a.txt b.txt Create a.txt Soft connection, named B.txt their inode value is different, the block value is the same, B modification does not affect a, it can be understood that B is a shortcut.


Six, sudo security
sudo modify config file Visudo find root all-(all) and all Plus Liang all-(root) All means linag This user can temporarily have root privileges on all IP addresses, The all of the third column means that you can use all command operations to change to Nopasswd:all so you don't need to enter a password every time you use a command.

650) this.width=650; "Width=" 463 "height=" 102 "alt=" sudo "src=" http://blog.lc-pb.com/wp-content/uploads/2015/09/ Sudo.png "/>
Sudo-l
To see what sudo command permissions the current user has


Seven, vim editor

GG back to the first line G back to the last line DD delete cursor in row

10DD Delete cursor under 10 lines YY copy cursor line DD except delete actually equivalent to cut 10yy copy cursor below 10 lines p paste copy content DW Delete A word yw copy a word 10j or 10space right move 10 characters 10h left move 10 characters

: 1, $s/replaced character/substituted character/g global replacement GC for selective substitution Jorian replaces only the first set number to display line numbers

: E filename opens another file directly

: R filename Copies the contents of another file directly to this file


This article is from the Linux blog, so be sure to keep this source http://lstulinux.blog.51cto.com/3938932/1694977

Linux Foundation One

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.