One, the basics -Linux

1. Advantages of Linux

  • Cross-platform hardware support
  • Rich software support
  • Multi-user and Multi-task (Permission control)
  • Reliable security (right management is perfect, viruses are difficult to obtain higher rights)
  • Good stability (no need to restart the system when installing the program)
  • Perfect network function (own network firewall)

2. Linux directory structure

3. Linux directory and file management

Echo Thanks>hello. TXT # vi hello. TXT # copy file cp Rm hello. TXT # delete directory (r: Rm -rf myproject # Move file (-f forcibly overwrite existing directory or file) mv -f newproject /homeCopy the code

4. Linux file attributes and permissions

Ls -l: can write a specific file or directory.Copy the code

4.1 Linux File Attributes

  • File type (first digit)
  • Ownership limit (the last three digits are a group) (Permissions of the user who created the modified file)
  • Group Permission (the last three digits are a group) (Permissions of the user group that creates the file)
  • Other user permissions (the last three digits are a group) (Permissions of the user group from which the user who created the file is not a member)

4.2 Linux File Directory

4.3 Modifying File Permissions on Linux

chmod 700 hello.txt
Copy the code

Explanation: the meaning of 700, the sum of each permission is equal to a number.

  • r : 4
  • w : 2
  • x : 1

The owner can read, write and execute the file. The owner group has no permission. Other user groups have no permission.

5. Manage Linux firewalls

5.1 Firewall Significance

5.2 Related Commands

Firewall-cmd --state # start service firewall start # start service firewall stop # restart service firewall restartCopy the code

5.3 Managing Network Ports on the Firewall

Firewall-cmd --permanent --add-port=8080-8085/ TCP Firewall-cmd --permanent --remove-port=8080-8085/ TCP # Firewall - CMD --permanent --list-servicesCopy the code