One, Lirux operating system installation

1. To facilitate demonstration and self-practice, install the VIRTUAL machine software first

2. Common VM software:

A, VirtualBox B, Vmware Worksation C, Virtual PCCopy the code

3. If the installation fails during VM software installation, virtualization may not be enabled in BI0S

BIOS --》 Security --》 Virtualization
Copy the code

4、开始安装虚拟机软件Vmware. worksation 12

5. Create a VM using VM software and install the Linux OS (centos-6.5 64-bit).

Overview of the Linux operating system

Operating System :_ (Operating System, 0S)

A. It is a piece of software in general terms. B. But unlike ordinary software, it is responsible for managing computer hardware and overall software resources. C. It runs directly on the "bare machine"Copy the code

2. Operating systems are classified according to application fields:

A, Desktop operating system: Mac OS, Windows, Linux B, Server operating system: I, operating system installed on a large computer II, Server requirements stable, secure, efficient iii, Windows Server, Linux C, embedded operating system: Ii, Android, i0S, Linux, Windows EmbeddedCopy the code

3. According to the number of users supported by the operating system:

A. Single-user operating system: a computer can only be operated by one user at a time. Windows, DOS B, and multi-user operating system: Multiple users can use the computer at the same timeCopy the code

4. According to the degree of source code openness:

A, Open source operating system: Linux, FreeBSD (an important branch of Unix) B, closed source operating system: Mac 0S, WindowsCopy the code

5. Introduction to Linux Operating System:

A, Linux: Linux is not Unix. B, Linux is not Unix. C, Linux is not UnixCopy the code

Linux directory related command operations

1. In Linux, the super administrator account is root, and the password is set during the system installation

2. In Linux, there is only one disk partition. / indicates the root directory of the disk system

3. Introduction to common level 1 directories in Linux:

A, /home user home folder, each user creates a folder under home B, /root super administrator's personal folder C, /bin contains binary files, executable files D, /etc configuration file folder, such as firewall etc e, /dev device folder Every device in Linux is abstracted into a fileCopy the code

4, the actual Linux server to save resources is only command line interface, no graphical interface

5. If Linux does not have a graphical interface installed, it will directly enter the command line mode at startup

6. There are two paths in Linux

A, the absolute path/usr/local/tomcat/ABC. JPG, relative path b webapps/def. JPGCopy the code

7, the command to view the current directory PWD (Linux commands are case-sensitive, generally all lowercase)

8, open the folder command CD

A, CD/Switch to the root directory B, CD.. C, CD Go back to the home directory, that is, home d, CD Directory name indicates the directory to be accessed. E, CD Enter some folder names. Press TAB to automatically complete the fileCopy the code

9. Run ls to view the list of all files in the current folder

A, ls-a indicates all files, including hidden files. B, ls-1 Displays the files in a list, one row. C, ls-al can take multiple parameters at a timeCopy the code

10. Create folder mkdir

Mkdir -p aa/bb/cc

Delete the empty folder rmdir

13. Run the rm command to delete files or directories

-f Forcible deletion -i Interactive mode, in which questions are asked before deletion. -r Recursive deletion Caution: If r is not specified, only files can be deleted but folders cannot be deletedCopy the code

14. Copy files or directories to cp

15. Run the mv command to move and change the file name

4, Linux file related command operations

1, create file command touch

2. Run vi/vim to edit the file

A. Command mode I. If the user uses the vi command to open the file, the user enters the command line mode II. If the user enters the space command, the cursor moves to the right by one character II. If the user enters the backspace command, the cursor moves to the left by one character II In the command mode, enter I/A/O to enter the editing mode. Enter DD to delete the current line II. Use NDD to delete n line B Ii. Press Esc to exit the editing mode and go to command mode C. Enter last line mode I. Enter: to enter last line mode II. Save and exit ii, q! Set nu to display all line numbers ii, s/ AAA/BBB/replace the first AAA of the current line with BBB ii, s/ AAA/BBB /g Replace all aaa of the current line with BBB $s/aaa/ BBB /g = $s/aaa/ BBB /g = $s/aaa/ BBB /g = $s/aaa/ BBB /gCopy the code

3. The cat command is used to display all the contents of a file

A. If the file is large, the screen will be turned to display B. Suitable for viewing files with less contentCopy the code

Head is used to view the beginning of the file. -n indicates the number of lines to view. The default value is the first 10 lines

5. Tail Is used to view the end content of a file. -n indicates the number of lines to view

5. Permission management in Linux

1. The system has the user root with the highest permission. The root user belongs to the root user group

2. The system has only the root permission to add and delete users by default

3. If no user group is specified, the system adds a user group with the same name to the user

4. No login is required when you switch from root to common user

5. Root can grant and revoke read, write, and execute permissions to a file

6. Run the su command to switch users

7. View the whoami command of the current user

8. Run the groups command to view the group of the current user

9. Add user useradd lisi

10. Change the password of passwd lisi. After you add a user, you must set a password for the user to log in

11. Delete user userdel

12. Add user group groupadd

13, modify user information usermod (can modify the user group to which the user belongs)

14. System file permissions are classified into three types: R-read read/W write write/X-execute

15. Each permission for each file is divided into three groups: U/G/O, that is, owner, group user, and other group user

16, you can also use binary form to simplify the representation of permissions:

101 (5) = r-x
111 (7) = rwx
100 (4) = r--
Copy the code

17. Run the chmod command to modify file permissions

A, chmod -r u+x, g+w f01 (-r indicates recursive authorization, that is, all files in the folder) b, chmod -r u= RWX, g=rw, o=rw f01 c, chmod 777 f01Copy the code

Six, in Linux | other orders

1. Ps to view the process

2. Ps -ef View all processes

3, ps – ef | grep bash lookup process is related to bash keyword,

4. Kill -9 PID: Terminates a process based on the process ID. -9 indicates that the process is forcibly terminated

5. Exit the monitor process command top CTRL + C

Clear is the screen clearing command

Cp –help cp –help cp –help cp –help

8. MNT commands for mounting devices, such as USB drives, are not used much anymore