Linux Basics Summary 2

Source: Internet
Author: User
Tags diff

1. Set the file Text property is: the file owner (u) increased write permission, and the file belongs to the same group of users (g) To increase the Write permission; other users (o) Remove Execute permissions: chmod ug+w,o-x log2012.log

Permission Selection parameters:

--reference=< directory or File > set to have the same permissions as the specified directory or file

--version displaying version information

< permissions >+< permissions settings > Allow directories or files within a permission scope to have the specified permissions

< permission scope >-< permission settings > Delete permission scope of directory or file specified permission

< permission range >=< permissions settings > Set permissions for a directory or a file in a permission range for a specified value

Permission range:

U: The current user of the directory or file

G: The current group of directories or files

O: Users or groups other than the current user or group of directories or files

A: All Users and Groups

Permission code:

R: Read permission, denoted by the number 4

W: Write permission, denoted by the number 2

X: Execute permission, denoted by the number 1

-: Delete permission, denoted by the number 0

S: Special Permissions
2. Use the CHGRP command to change the file and directory to belong to the group, this way using the group name or group identification code can be. The CHGRP command is the abbreviation for change Group! The group name to be changed must exist within the/etc/group file.

3. Chown Changes the owner of the specified file to the specified user or group, which can be either a user name or a user ID; a group can be a group name or a group ID; a file is a space-separated list of files to change permissions, and wildcard characters are supported. System administrators often use the Chown command,

After copying the file to another user's directory, let the user have permission to use the file.

4. linux/etc/group files and/etc/passwd and/etc/shadow files are related to the system administrator's management of users and user groups. Linux/etc/group files are available about system administrators to users and user groups

Managed files, all information from the Linux user group is stored in the/etc/group file. A user group is a collection of users with a common feature. User group profiles are primarily/etc/group and

/etc/gshadow, where/etc/gshadow is the/etc/group encrypted information file.

Grouping users is a means of managing and controlling access to users in a Linux system. Each user belongs to a group of users, a group can have multiple users, and a user can belong to a different group. When a user simultaneously

When you are a member of more than one group, the primary group that the user belongs to is recorded in the/etc/passwd file, which is the default group to which the login belongs, and the other groups are called additional groups.

All the information for the user group is stored in the/etc/group file. The format of this file is separated by a colon (:) several fields, these fields are as follows: Group name: password: Group ID: List of users in group

5. the ping under Linux is slightly different from the ping under Windows, the Linux ping does not automatically terminate, you need to press CTRL + C to terminate, or use the parameter-C to specify the number of responses required to complete.

Ping-c 10-i 0.5 ping times, I interval

Ping-c 5 ping domain name

Ping-i 3-s 1024-t 255 3 send period is 3 seconds-S set send package size to 1024-t set TTL value to 255

6. The netstat command is used to display statistics related to IP, TCP, UDP, and ICMP protocols, and is typically used to verify the network connectivity of each port on the machine. Netstat is a program that accesses the network and related information in the kernel, which provides a TCP connection,

Reports on TCP and UDP snooping, process memory management.

7. NETSTAT-ANP//A All, n digital form display, p process number, T TCP link, u UDP link

8. scp-r local_folder [email protected]_ip:remote_folder

9. ln links are also soft links and hard links two, soft link is the ln–s source file destination file, it will only be in the location you selected to generate a file image, will not occupy disk space, hard link ln source file destination file, no parameter-s,

It will generate a file of the same size as the source file in the location you selected, whether it is a soft link or a hard link, and the file keeps changing synchronously.

the directory creation link must use an absolute path, and relative path creation will be unsuccessful, prompting: the number of layers of the symbolic connection is too many errors

A . diff command can compare individual files or directory contents. If you specify that the comparison is a file, it is only valid if the input is a text file. Compare the similarities and differences of text files in a row-by-line manner. If you specify that the comparison is in the directory,

The diff command compares a text file with the same name in two directories. Lists the different binaries, common subdirectories, and files that appear only in one directory.

Diff Log2014.log Log2013.log-y-W compares the contents of two files and displays them in parallel; "|" Indicates that the contents of the front and back 2 files are different, "<" means that the following file is 1 lines less than the previous file, ">" means that the following file is 1 lines more than the previous file.

date-s "20080523 01:01:01″//so you can set the whole time

the CAL command can be used to display a Gregorian calendar. Cal-y 2013 shows the 2013 calendar; Cal Displays the year calendar

grep-n ' Linux ' test.txt//Find keywords from files,-n Displays line numbers, you can omit

Grep-n ' Linux ' test.txt test2.txt//Find in multiple files simultaneously

Cat Test.txt |grep ^u//Find out what line is starting with u

Cat Test.txt |grep-e "ed|at"//displays content lines containing ed or at characters.
The function of the WC (Word Count) command in a Linux system is to count the number of bytes, words, and lines in the specified file, and display the output of the statistics.

-C Count bytes. -L counts the number of rows. -M counts the number of characters. This flag cannot be used with the-C flag. -W count words. A word is defined as a string separated by a blank, a jump, or a newline character.

-L Prints the length of the longest line. -HELP Display Help Information--version display version information

the PS command in Linux is the abbreviation for process status. The PS command is used to list those processes that are currently running on the system. The PS command lists the current snapshots of those processes, that is, those processes that are executing the PS command at the moment, if you want dynamic

You can use the top command to display process information.

Command parameters:-A Show All processes,-e equals "-A" E shows environment variable F shows relationship between programs

a specified task is performed at a specified time and can only be performed once and the ATD process needs to be opened

Linux Basics Summary 2

Related Article

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: 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.