Linux common commands (ii)

Source: Internet
Author: User

The file Processing command is followed by an article

Cat concatenate and display fils viewing small files

More Paging Display file

Blank or F page, enter the next line, Q or Q exit.

Head–num num represents the number of rows that are displayed before the NUM line

Tail–num ibid only from the rear display, that is, after the NUM line is displayed

Soft links (similar to Windows shortcuts)

Permissions for lrwxrwxrwx point to source file

The soft link is invalid if the source file is deleted

Can be used across file systems, such as/with ETX3 and other/test etx4, soft links can be in the/test source file in/

Hard Links

The time is the same as the source file and is updated synchronously, a bit like copy,cp-p can make the new file time the same as the original.

Deleting a source file is like losing a map. The Linux kernel knows only numbers, so all the file directories have inode tags, and I feel a bit like a handle,

Hard links and source files correspond to the same inode tag, so deleting source files hard links can also be used, and they are updated synchronously.

Hard links can not cross the file system, soft links can be, should be specific to solve the situation.

Rights Management Commands

Basic method (less)

chmod [{ugo}{+-=}{rwx}] [file directory]

Advanced methods

R-4 Read

W-2 Write

X-1 execution

Sort Ugo 752 The corresponding permission is rwxr-x-w-rwx-xr--x the corresponding number is 731

So you can directly chmod 722 file names

Su-user name cut user admin cut general user do not password, the contrary need, general cut also need, the administrator cut out after input exit directly back to Admin user

RWX 7

Rw-6

R-x 5

r--4

-WX 3

-w-2

--x 1

---0

Three empty permutation combinations can be represented with 2^0,2^1,2^2 124

The following definitions are available for Linux permissions

Name file directory

R can read files to view the contents of the file can be ls out of the contents of the directory

W can modify the contents of the file can be deleted to add files in the directory

x executable file to enter directory

From the above we can know that a directory without W permission, even if the file has W permission can not delete this file!

Chown Change file directory owner Chown file owners

CHGRP Ibid. linux Default group has ADM

Umask–s Viewing the default permissions when creating a file directory

Umask View the first 0 in the permission mask 0022 is the privilege mask that is followed by the user permission bit after the special permission bit requires 777 to lose the value is the true permission code

777-022=755 Correspondence Rwxr-xr-x

Changes also need to give a mask if you want to change to 744 you have to enter Umask 0033

Files created by Linux default cannot accept executable permissions

Linux common commands (ii)

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.