gogoWebsite

Linux Getting Started Tutorial (very detailed) from zero to proficient, read this one is enough!

Updated to 6 months ago

Linux

  • I. Why learn linux
  • II. Introduction to the catalog
  • III. vi / vim editor
  • IV. Network configuration
    • 4.1 Modifying the IP address
    • 4.2. Configuring the hostname
      • 4.2.1. Modifying the host name
      • 4.2.2 Modifying the hosts mapping file
  • V. System configuration
    • 5.1. service Service Management
    • 5.2、systemctl
    • 5.3. Firewalls
    • 5.4. Shutdown and restart command
    • 5.5. Viewing the system kernel and version
  • VI. Common commands
    • 6.1. File directory class
      • 1), pwd show the absolute path of the current working directory
      • 2)、ls List the contents of the directory
      • 3)、cd switch directory
      • 4), mkdir to create a new directory, rmdir to delete an empty directory
      • 5), touch create empty files
      • 6), cp copy files or directories
      • 7)、rm Delete files or directories
      • 8), mv Move files and directories or rename them
      • 9)、cat View the contents of the file
      • 10), more file content split-screen viewer
      • 11), less Split-screen display of the contents of the file
      • 12), echo output content to the console
      • (14), tail output file tail content
      • 15)、> Output redirection and >> Append
      • 16), ln soft links
      • (17), history View the history of commands that have been executed
      • 18), time and date class
    • 6.2 User management commands
      • 1)、useradd Add New User
      • 2)、passwd set user password
      • 3)、id Check if the user exists
      • 4), cat /etc/passwd to see which users have been created
      • 5)、su switch user
      • 6)、userdel Delete user
      • 7)、sudo set ordinary users with root privileges
      • 8)、usermod Modify user
      • 9)、groupadd New group
      • 10)、groupdel Delete group
      • 11)、groupmod Modify group
      • 12), cat /etc/group to see what groups have been created
    • 6.3 Document Permission Class
      • 1)、Document Properties
      • 2)、Chmod change permissions
      • 3)、Chown Change owner
      • 4)、chgrp Change the belonging group
    • 6.4. Search and find categories
      • 1)、find Find a file or directory
      • 2)、locate quickly locate the file path
      • 3), grep filter find and | pipeline character
    • 6.5. Compression and decompression classes
      • 1)、gzip/gunzip compression
      • 2)、Zip/unzip compression
      • 3)、tar Packaging
    • 6.6. Disk View and Partition Classes
      • 1), du View the disk space occupied by files and directories
      • 2), df Viewing disk space usage
      • 3), lsblk view device mounts
      • 4)、mount/umount Mount/Unmount
      • 5), fdisk partition
    • 6.7 Process management classes
      • 1), ps view the current system process status
      • 2), kill terminate the process
      • 3), pstree View process tree
      • 4), top real-time monitoring system process status
      • 5), netstat display network status and port occupancy information
      • 6)、crontab Timed Task Setting
  • VII. Software package management
    • 7.1、BPM
      • 1), RPM installation command (rpm -ivh)
      • 2)、RPM query command (rpm -qa)
      • 3)、RPM uninstall command (rpm -e)
    • 7.2 YUM Repository Configuration
      • 1)、Common commands of YUM

I. Why learn linux

Because we are deploying services, Linux systems have always been known for their stability; they can run continuously for years without any major problems. In fact, many Linux users have never experienced a system crash in their environment. As opposed to windows, hangs and crashes are a complete norm.

Windows, being a commercial product, has closed source code and we have no way of knowing what Microsoft has done in it. Linux, on the other hand, does not have this problem because it is an open source operating system.

在这里插入图片描述

II. Introduction to the catalog

Everything is a file on a linux system

在这里插入图片描述在这里插入图片描述

在这里插入图片描述

  • /bin
    It stands for binary, and this directory holds the most frequently used commands. You can see an arrow in the bin folder on the desktop above, linking to /usr/bin, which is the equivalent of a shortcut to /bin, which is the same as /usr/bin.
    在这里插入图片描述

  • /sbin
    s is for Super User, where the system administration program used by the system administrator is stored.

  • /home
    The home directory that holds ordinary users. In Linux each user has a directory of his or her own, and a version of this directory is named after the user's account.

  • /root
    This directory is the user home directory for system administrators, also known as super-privileged people.

  • /lib
    The most basic dynamic connection shared libraries required for system startup are similar to DLL files in windows. Almost all applications need to use these shared libraries.

  • /etc
    All configuration files and subdirectories needed for system administration.

  • /usr
    This is a very important directory where many of the user's applications and files are placed, similar to the program fies directory under windows.

  • /boot
    This is the place to store some of the core files used when booting linux, including some connection files as well as image files, don't put your own installation here.

  • /proc
    This directory is a virtual directory which is a map of the system memory and we can get system information by accessing this directory directly.

  • /srv
    service abbreviation, this directory stores some data that needs to be extracted after the service is started.

  • /sys
    This is a big change in the linux 2.6 kernel. This directory installs sysfs, a file system new to the 2.6 kernel.

  • /tmp
    This directory is used to store some temporary files.

  • /dev
    Similar to windows device manager, stores all hardware in a file. Manages all devices such as CPU, hard disk, etc.

  • /media
    The linux system will automatically recognize some devices, such as USB flash drives, CD-ROM drives, etc. When recognized, linux will mount the recognized devices to this directory.
    centos7 migration to /run/media

  • /mnt
    The system provides this directory to allow users to temporarily mount other filesystems. We can mount external storage on /mnt and then go to this directory to view the contents. It's similar to media.

  • /opt
    This is the directory where additional software is installed for the host. For example, if you install a mysql database, you can put it in this directory. It is empty by default.

  • /var
    This directory holds things that are constantly expanding, and we are used to putting directories that are frequently modified in this directory. This includes various log files.

  • /lost+found
    This directory is normally empty, and when the system is shut down illegally, some files are stored here.

  • /www
    The /www directory can be used to store web applications or website files. The /www directory has no special purpose, it is just a regular directory that can be used and managed as needed.

III. vi / vim editor

User@Hostname consists of ~ for the current directory location, # for the administrator user, and $ for all normal users.
在这里插入图片描述

在这里插入图片描述

VI is the most common text editor for Unix and Unix-like operating systems, and VIM is a more powerful text editor developed from VI, with active syntax color recognition for easy program design. VIM is a more powerful text editor developed from VI. It can actively identify correct syntax by font color, which is convenient for programming.

在这里插入图片描述
Mode conversion

Come in the default general mode, if you want to edit the text, press i to enter the edit mode
在这里插入图片描述
Common vim syntax

General mode

在这里插入图片描述
Edit Mode

在这里插入图片描述Press "Esc" key to exit the editing mode, and then the mode you are in is the general mode.

command mode

在这里插入图片描述

IV. Network configuration

4.1 Modifying the IP address

vim /etc/sysconfig/network-scripts/ifcfg-ens33

在这里插入图片描述

fulfillmentservice network restart Reboot the network to enable it.

4.2. Configuring the hostname

4.2.1. Modifying the host name

1), view the current server host name

hostname

2)、Modify the hostname by editing the /etc/hostname file.

vim /etc/hostname

The changes took effect after reboot.

4.2.2 Modifying the hosts mapping file

vim /etc/hosts

After adding the mapping and saving it, you can access the service directly and it will be able to access 220.151 ip
在这里插入图片描述

V. System configuration

5.1. service Service Management

Processes and Services in Linux
In a computer, a program or command that is being executed is called a "process" (process).
A process that exists in memory for a period of time after startup is generally referred to as a "service".

service service name start | stop |- restart | status

The way to view the services: /etc//service name , found that only two services are reserved in service
在这里插入图片描述

chkconfig Setting the self-start configuration for background services

在这里插入图片描述
2)、Enable / disable network (network) service automatic startup

chkconfig network on

chkconfig network off

3)、Enable/disable automatic startup of network service at specified level.

chkconfig --level Specify the level network on

5.2、systemctl

1)、Basic Grammar

systemctl start | stop | restart | status Service Name

2), the method to view the service: /usr/lib/systemd/system

cd /usr/lib/systemd/system

ll command to view all services
在这里插入图片描述

systemctl Setting the self-start configuration for background services

1、View all service boot startup status

systemctl list-unit-files

2. Turn off the automatic startup of the specified service

systemctl disable service_name

3、Enable the automatic startup of the specified service

systemctl enable service_name

5.3. Firewalls

1), view, change the firewall status

systemctl status firewalld #view firewall status

systemctl stop firewalld # Shut down the firewall

systemctl start firewalld # turn on the firewall

systemctl enable # boot firewalld

systemctl disable # disable the firewall at boot time

2)、Firewall open and delete ports

firewall-cmd --list-ports #Query all open ports

firewall-cmd --query-port=8080/tcp #Query whether the port is open

firewall-cmd --add-port=8080/tcp --permanent #Permanently added8080ports
firewall-cmd --add-port=65001-65010/tcp --permanent #Permanent increase65001-65010ports

firewall-cmd --remove-port=8800/tcp --permanent #permanent deletion8080ports

# (math.) a certainip开放某个ports
firewall-cmd --permanent --add-rich-rule=“rule family=“ipv4” source address=“192.168.142.166” port port=“5432” protocol=“tcp” accept”

# 删除(math.) a certainip开放某个ports
firewall-cmd --permanent --remove-rich-rule=“rule family=“ipv4” source address=“192.168.142.166” port port=“5432” protocol=“tcp” accept”

Order Interpretation

firwall-cmd: is a utility (service) command provided by Linux to operate firewall
--zone #scope
--add-port=8080/tcp #add port, format: port/communication protocol; add means add, remove corresponds to remove
--permanent #permanent, without this parameter after a reboot will not be effective

3), update the firewall rules, change the configuration to perform reload configuration

firewall-cmd --reload

5.4. Shutdown and restart command

0), synchronize data from memory to hard drive

sync

1), reboot

reboot
# Both work the same way
shutdown-r now

2)、Shutdown

# Shut down now
shutdown-h now

# The computer will shut down after 1 minute and will be displayed on the logged in user's current screen
shutdown -h 1 'This server will shut down after 1 mins'

# Specify a time to shut down
shutdown 15:28

# Cancel the shutdown
shutdown -c

5.5. Viewing the system kernel and version

1), view kernel / operating system / CPU information

uname -a

在这里插入图片描述

2), view centos specific version

cat /etc/centos-release

在这里插入图片描述

VI. Common commands

6.1. File directory class

1), pwd show the absolute path of the current working directory

pwd

2)、ls List the contents of the directory

 ls: lists files and subdirectories in the current directory.
 ls -l: lists files and subdirectories in the current directory in long format, including detailed information such as file permissions, owner, file size, and modification date.
 ls -a: lists all files and subdirectories in the current directory, including hidden files and directories.
 ls -h: lists file sizes in human-readable format, e.g., using units such as KB, MB, GB, etc.
 ls -t: lists files and subdirectories sorted by modification time, with the most recently modified files and directories displayed at the top.
 ls -r: lists files and subdirectories in reverse order, i.e. starting from the last file or directory.
 ls -R: recursively lists all files and subdirectories in the current directory and its subdirectories.
 ls -i: displays the inode number of each file and directory.

ls [Options] [Directory or File]

Multiple arguments can be combined such as: ls -al

The information listed on each line is, in order: file type and permissions, number of links, file owner, file group, file size in bytes, creation or last modification time, and name.

3)、cd switch directory

在这里插入图片描述

4), mkdir to create a new directory, rmdir to delete an empty directory

mkdir [options] directory to create

mkdir xiyou
mkdir -p xiyou/dssz/meihouwang # -p create multi-tier directory

rmdir Empty directory to be deleted

rmdir xiyou/dssz/meihouwang

5), touch create empty files

touch File name

touch xiyou/dssz/

6), cp copy files or directories

cp source file target file

1)、Copying documents

cp xiyou/dssz/ xiyou/mingjie/

(2), recursive copy rectification folder
Arguments: -r recursively copies the entire folder

cp -r xiyou/dssz/ ./

7)、rm Delete files or directories

rm [option] deleteFile (Function: recursively delete all contents of a directory)

在这里插入图片描述

rm # Delete the file

rm -rf dssz/ # Recursively delete everything in the directory

8), mv Move files and directories or rename them

mv source file target file

(1) mv oldNameFile newNameFile (Function: Rename)

(2) mv /temp/movefile /targetFolder (Function: Move File)

# Rename
mv xiyou/dssz/ xiyou/dssz/

# Move files
mv xiyou/dssz/ . /

9)、cat View the contents of the file

View the contents of the file, displayed from the first line.

Generally view a relatively small file, a screen can display the whole.

cat -n # The -n parameter displays the line number.

10), more file content split-screen viewer

more Files to view

在这里插入图片描述

more  

11), less Split-screen display of the contents of the file

The less instruction is used to view the contents of a file in a split screen, its function is similar to the more instruction, but more powerful than the more instruction, and it supports various display terminals. less instruction does not load the whole file once before displaying the contents of the file, but loads the contents according to the display needs, and it has high efficiency for displaying large files.

在这里插入图片描述

less  

12), echo output content to the console

echo [Options] [Output]

Can be used to output logs when writing scripts

e: Support for backslash-controlled character conversion
在这里插入图片描述

echo "hello\tworld"

echo -e "hello\tworld" # -e supports backslash controlled character conversion

在这里插入图片描述

(14), tail output file tail content

tail is used to output the contents of the end of the file. By default, the tail command displays the last 10 lines of the file.

# View the last 1 line of the file
tail -n 1

# Track all updates to the file in real time
tail -f

check or refer toctrl + s Pausepressctrl + q Continue

15)、> Output redirection and >> Append

(1) Write the ls view information to a file

ls -l>

(2) Append the ls view information to the file

ls -l>>

(3) Use echo to append the word hello to a file.

echo hello>>

16), ln soft links

Soft links, also known as symbolic links, are similar to shortcuts in windows, and have their own block of data, mainly storing the paths to other files.

ln -s [original file or directory] [softlink name] (function description: create a softlink to the original file)

1)、Create soft connection

 ln -s /home/ ./lnTxt

Remove softlinks: rm -rf softlink name, not rm -rf softlink name/
If you use rm -rf to remove the soft link name/, the contents of the real directory corresponding to the soft link will be deleted.

rm -rf lnTxt

Query: you can view it by ll. The 1st bit of the list attribute is l, and the tail will point to the location.

(17), history View the history of commands that have been executed

(1) Viewing the history of commands that have been executed

history

(2) Empty history records

history -c

18), time and date class

(1) Display current time information

date

在这里插入图片描述
(2) Setting the current system time

date -s "2023-06-19 20:52:18"

6.2 User management commands

1)、useradd Add New User

useradd user name (Function: Add new user)

useradd -g group name username (Function: Add a new user to a group)

(1) Add a user

useradd hmb

2)、passwd set user password

passwd user name (Function: Set user password)

(1) Setting the user's password

passwd hmb

在这里插入图片描述

3)、id Check if the user exists

id User name

(1) Check if the user exists

id hmb

在这里插入图片描述

4), cat /etc/passwd to see which users have been created

See what users have been created

cat /etc/passwd

5)、su switch user

su User name (Function description: switch users, can only get the user's execution privileges, can not get the environment variables)

su - user name (Function: switch to a user and get that user's environment variables and execution privileges)

(1) Switching users

su hmb

su - hmb

在这里插入图片描述

6)、userdel Delete user

(1) userdel user name (Function: Deletes the user but preserves the user's home directory)

(2) userdel -r user name (Function: User and user home directory, both deleted)

userdel hmb

userdel -r hmb

7)、sudo set ordinary users with root privileges

sudo mkdir module

8)、usermod Modify user

usermod -g user group username

在这里插入图片描述

(1) Adding users to user groups

usermod -g root zhubajie

9)、groupadd New group

groupadd Group name

(1) Add a xitianqujing group

groupadd xitianqujing

10)、groupdel Delete group

groupdel Group name

(1) Delete xitianqujing group

groupdel xitianqujing

11)、groupmod Modify group

groupmod -n new group name old group name
在这里插入图片描述

groupmod -n xitian xitianqujing

12), cat /etc/group to see what groups have been created

cat /etc/group

6.3 Document Permission Class

1)、Document Properties

在这里插入图片描述
utilizationllmaybels -lhCommand to view permissions

If you don't have permission, you'll just get a minus sign [ - ]. From left to right with these numbers 0-9:.

  • 0 The first bit indicates the type
    • The first character in Linux means that the file is a directory, a file, a linked file, etc.
    • Delegate documents
    • d for directory
    • l Link file;
  • Bits 1-3 determine what permissions the owner (the person who owns the file) has on the file. -User
  • Bits 4-6 determine which group (the owner's peer group) has permissions on the file, -Group
  • Bits 7-9 determine which other users have permissions on the file -Other

(1), rwx role files and directories of different interpretations

  • (1) Acting on documents:
    [ r ] is for read: can be read, viewed
    [ w ] stands for write: the file can be modified, but not deleted, before deleting a file.
    [ x ] means execute: can be executed by the system.

  • (2) Role to the catalog:
    [ r ] is for read: you can read, ls view the contents of the directory
    [ w ] for write: can modify, create + delete + rename directories within directories
    [ x ] means execute: you can enter the directory.

llCommand View Explanation

在这里插入图片描述
ls -lh command, the file size will be clearer

在这里插入图片描述

(1) If the view is a file: the link count refers to the number of hard links.
(2) If you are viewing a folder: the number of links refers to the number of subfolders.

2)、Chmod change permissions

在这里插入图片描述

1)、The first way to change the authority

chmod [{ugoa}{+ - =}{rwx}] file or directory

u:owner (user) g:all groups o:others a:all people (sum of u, g, o)

The + sign is for adding - sign is for canceling = sign is for giving directly

(1) Modify the file so that the master user to which it belongs has execution privileges.

chmod u+x 

(2) Modification of documents so that the users of the group to which they belong have execution rights.

chmod g+x 

(3) Modify the execution rights of the main user to whom the file belongs, and enable other users to have execution rights.

chmod u-x,o+x 

2)、Second way to change the authority

chmod [mode=421 ] [Files or directories]

r=4         w=2        x=1       rwx=4+2+1=7

(1) Using a numerical approach, set the file owner, the group to which he or she belongs, and other users to have read, write, and execute permissions.

chmod 777 

(2) Modify all files inside the entire folder with read-write-execute permissions for all owners, groups, and other users.

chmod -R 777 xiyou/

3)、Chown Change owner

chown [options] [end-user] [file or directory] (Function: Change the owner of a file or directory)

(1) Modification of document owner

chown hmb 

(2) Recursively change the file owner and all groups

chown -R hmb:hmb xiyou/

4)、chgrp Change the belonging group

chgrp [end-user group] [file or directory] (Function: Change the group to which a file or directory belongs)

(1) Modification of the group to which the document belongs

chgrp root 

6.4. Search and find categories

1)、find Find a file or directory

The find command recursively traverses the subdirectories of the specified directory and displays the files that satisfy the conditions in the terminal.

在这里插入图片描述

(1) By filename: Find files in the / directory by name.

find -name "ln*.txt"  

find xiyou/ -name "*.txt"

在这里插入图片描述

(2) By owner: find the file in the /opt directory with the username -user

find opt/ -user hmb

(3) By file size: find files larger than 200m in the /home directory (+n is greater than -n is less than n is equal to)

find /home -size +204800

2)、locate quickly locate the file path

The locate command utilizes a pre-established locate database of all file names and paths in the system to quickly locate a given file. the locate command does not need to traverse the entire file system, so the query speed is faster. In order to ensure the accuracy of the query results, the administrator must periodically update the locate time.

Basic syntax: locate Search for files

Since the locate command is based on a database query, the locate database must be created using the updatedb command before it is run for the first time.

(1) Query folder

updatedb

locate tmp

3), grep filter find and | pipeline character

The pipeline character, "|", means that the output of the previous command will be passed to the later command for processing, so you can pass what you find out in the front to the back end of the pipeline character for processing, for example, ls | grep -n test

grep is a commonly used text search tool on Linux systems that looks for a specified string or regular expression in a file and outputs the matching line to a terminal or file.

(1) Finding characters in a file

# Find in a single file
grep "string" filename

# Find characters in multiple files
grep "string" file1 file2 file3

# Find the specified string regardless of case
grep -i "string" filename

(2), recursively find the specified string in the directory

grep -r "string" directory

(3), display the line number of the matching line

grep -n "string" filename

(4), reverse search does not contain the specified string of lines

grep -v "string" filename

(5), the matching line output to the file

grep "string" filename > 

6.5. Compression and decompression classes

1)、gzip/gunzip compression

Attention:

(1) Only files can be compressed, not directories
(2) Non-retention of the original document
(3) Multiple files at the same time will generate multiple zip files.

(1), gzip compression

gzip file

gzip

在这里插入图片描述
(2), gunzip decompression file

gunzip 

2)、Zip/unzip compression

The zip compression command is common to both windows and linux, and can compress directories while preserving source files.

(1), zip compression

zip compressed filename.zip source file

# zip file
zip

# -r compressed folder
zip -r nginx-1.21.6

(2), unzip decompression

unzip

# -d Specify the directory where the unpacked files will be stored
unzip -d /opt

3)、tar Packaging

tar [option] Pack the contents to be packed in (Function: Pack directory, compressed file format.)

在这里插入图片描述
(1) Compressed files

tar -zcvf The name of the packaged file. [source file]

# Multiple files to package
tar -zcvf

# Pack the folder
tar -zcvf xiyou/

(2) Decompression

# Unzip to the current directory
tar -zxvf
# -C Unzip to a directory
tar -zxvf -C /opt

6.6. Disk View and Partition Classes

1), du View the disk space occupied by files and directories

du directories/files (Function: displays disk usage for each subdirectory of a directory)

在这里插入图片描述

# View current total file occupancy
du-sh

# View the current file footprint of all files in the current directory
du -sh *

# Disk usage of all files in a folder
du -sh /home/*

# -c shows the total
du -csh /home/*

在这里插入图片描述
在这里插入图片描述

2), df Viewing disk space usage

df option (Function: lists the overall disk usage of the file system and checks the disk space usage of the file system)

(1) Viewing Disk Usage

df -h

在这里插入图片描述

3), lsblk view device mounts

lsblk

# View detailed device mounts, display file system information
lsblk -f

在这里插入图片描述

4)、mount/umount Mount/Unmount

For Linux users, no matter how many partitions there are and which directories they are assigned to, it is always a root directory, a separate and unique file structure.

Each partition in Linux is used to form part of an entire filesystem, which is handled in a way called "mounting", where the entire filesystem contains a whole set of files and directories, and associates a partition with a directory, and the partition to be mounted will get its storage space in that directory.

Syntax: mount [-t vfstype] [-o options] device dir (Function: Mount device)

在这里插入图片描述

(1) Mount the CD-ROM image file

# Create the mount point
mkdir /mnt/cdrom/

# Mount device /dev/cdrom to mount point: /mnt/cdrom
mount -t iso9660 /dev/cdrom /mnt/cdrom/

(2) Uninstall the CD-ROM image file

umount /mnt/cdrom

(3) Setting up power-on auto-mount

vi /etc/fstab

Add the following sentence and save to exit
在这里插入图片描述

5), fdisk partition

Note: This command must be used by the root user to work

Basic Grammar:

fdisk -l (Function: View disk partition details)

fdisk Hard Disk Device Name (Function: Perform partition operation on the newly added hard disk)

在这里插入图片描述

1)、Functional Description

  • Linux Partitions
    Device: Partition Sequence
    Boot.
    Start: from the X-mag column
    End: to the end of the Y-column
    Blocks: Capacity
    Id: Partition type ID
    System: Partition type
  • Partition Operation Key Description
    m: Display a list of commands
    p: show current disk partition
    n: new partition
    w: Write partition information and exit
    q: Exit directly without saving partition information

6.7 Process management classes

A process is a program or command that is being executed, and each process is a running entity that has its own address space and occupies certain system resources.

1), ps view the current system process status

ps -ef: lists detailed information of all processes, including process PID, PPID, CPU usage, memory usage, etc.

ps aux: similar to ps -ef, but shows process information for all users.
在这里插入图片描述

ps aux

ps -ef

  1. ps aux Displays a description of the message:
    USER: the user who spawned the process
    PID: ID number of the process
    %CPU: the percentage of CPU resources occupied by the process, the higher the occupation, the more the process consumes resources;
    %MEM: the percentage of physical memory occupied by the process, the higher the occupation, the more resource intensive the process is;
    VSZ: The size of the virtual memory occupied by the process, in KB;
    RSS: the size of the actual physical memory occupied by the process, in KB;
    TTY: The terminal in which the process is running. For CentOS, tty1 is the graphical terminal.
    tty2-tty6 is the local character interface terminal. pts/0-255 represents the virtual terminal.
    STAT: process state. Common states are: R: Running state, S: Sleep state, T: Suspended state,
    Z: zombie state, s: contains child processes, l: multi-threaded, +: foreground display
    START: the start time of the process
    TIME: the computing time of the CPU used by the process, not the system time
    COMMAND: the name of the command that spawned this process
  2. ps -ef Displays the message description:
    UID: User ID
    PID: Process ID
    PPID: Parent Process ID
    C: Factor used by the CPU to calculate execution priority. Larger values indicate that the process is CPU-intensive computing, the
    The execution priority decreases; smaller values indicate that the process is I/O intensive and the execution priority increases.
    STIME: the time the process was started
    TTY: full terminal name
    TIME: CPU time
    CMD: Commands and parameters used to start the process

(1) with grep query java process, find out the PID, then you can kill the process

ps -ef | grep java
ps aux | grep java

ps -ef | grep java service name

2), kill terminate the process

(1) Terminate processes by pid

# -9 means to force the process to stop immediately
kill -9 5102

(2) Kill processes by process name

killall firefox

Window kills the process:

taskkill /f /pid Process ID

3), pstree View process tree

# Display the PID of the process
pstree -p
# Display the user to which the process belongs
pstree -u

4), top real-time monitoring system process status

Parameter Options:
在这里插入图片描述

top

在这里插入图片描述

在这里插入图片描述

  1. The first line of information is the task queue information
    在这里插入图片描述

  2. Process information for the second act
    在这里插入图片描述

  3. Third line CPU information
    在这里插入图片描述

  4. The fourth line is physical memory information
    在这里插入图片描述

  5. The fifth line is swap information.
    在这里插入图片描述

5), netstat display network status and port occupancy information

Using netstat is often used to see if a port is occupied

netstat -anp | grep process number or port number
netstat -nlp | grep port number

在这里插入图片描述
Window view:

netstat -ano | findstr port number

6)、crontab Timed Task Setting

crontab -e

在这里插入图片描述
(1) Restart the crond service

systemctl restart crond

(2), every minute, add a number 11 to the /root/ file.

*/1 * * * * /bin/echo ”11” >> /root/

VII. Software package management

7.1、BPM

RPM (RedHat Package Manager), RedHat package management tools, similar to windows inside the Linux series of operating systems inside the packaging and installation tools, it is RedHat's logo, but the concept is universal.

RPM package name format
Apache-1.3.23-11.

  • "apache" software name
  • "1.3.23-11" the version number of the software, the main version and this version
  • "i386" is a generic term for the hardware platform on which the software runs, the Intel 32-bit processor.
  • The "rpm" file extension, which stands for RPM package.

1), RPM installation command (rpm -ivh)

在这里插入图片描述

rpm -ivh package name.rpm

2)、RPM query command (rpm -qa)

Syntax: rpm -qa (Function: Query all installed rpm packages)

Because of the large number of packages, filters are usually applied. rpm -qa | grep rpm packages
Example: query firefox software installations

rpm -qa |grep firefox

3)、RPM uninstall command (rpm -e)

rpm -e RPM package

# Uninstall the software without checking for dependencies. In this case, software that uses the package may not work properly afterward.
rpm -e --nodeps package

7.2 YUM Repository Configuration

YUM (known as Yellow dog Updater, Modified) is a Shell front-end package manager in Fedora and RedHat and CentOS. Based on RPM package management, it can automatically download RPM packages from specified servers and install them, handle dependencies automatically, and install all dependent packages at once without tedious downloading and installing them over and over again.

在这里插入图片描述

1)、Common commands of YUM

Syntax: yum [options] [arguments]

Options:
在这里插入图片描述

Parameters:
在这里插入图片描述

(1) Install firefox using yum.

besides the subject matter

People who are new to the computer industry orUniversity graduates of computer-related majors, many due to the lack of real-world experience, employment everywhere. Here we look at two sets of data:

  • The 2023 class of national college graduates is expected to reach 11.58 million, making the employment situation grim;

  • Data released during the National Cybersecurity Awareness Week shows that by 2027 there will be a shortfall of 3.27 million cybersecurity personnel in China.

    On the one hand, the employment situation of fresh graduates every year is grim, and on the other hand, there is a million gap in cybersecurity talents.

On June 9, the 2023 edition of the Employment Blue Book (including the 2023 China Undergraduate Employment Report and the 2023 China Higher Vocational Student Employment Report) of McKesson Research was officially released.

Top 10 Majors with Higher Monthly Earnings for College Graduates in the Class of 2022

The monthly income of undergraduate computer science and senior automation majors is higher.The monthly income of undergraduate computer science and senior automation majors in the class of 2022 is 6863 yuan and 5339 yuan respectively. Among them, undergraduate computer class professional starting salary is basically the same as the 2021 session, senior automation class monthly income growth is obvious, the 2022 session of the counter overtake the railway transportation class (5,295 yuan) in the first place.

Looking specifically at majors, the higher monthly undergraduate income for the Class of 2022 is information security ($7,579). Compared with the class of 2018, electronic science and technology, automation and other undergraduate majors related to artificial intelligence are not bad, compared with five years ago, the starting salary increase have reached 19%. Data science and big data technology, although a new major in recent years but bright performance, has been among the top three undergraduate graduates of the class of 2022 in the higher monthly income six months after graduation majors. The only humanities and social sciences major that entered the top 10 undergraduate high salary list five years ago - French has dropped out of the top 10.

"There can be no national security without cybersecurity." At present, cybersecurity has been elevated to the height of national strategy and has become one of the crucial factors affecting national security and social stability.

Cybersecurity Industry Characteristics

1, employment salary is very high, fast salary increase 2021 hunting network released network security industry employment salary industry highest per capita 33.77 million!

2. Large talent gap and many employment opportunities

On September 18, 2019, the official website of the Central People's Government of the People's * published: the demand for cyberspace security talents in China is 1.4 million people, while the major schools across the country train less than 1.5W people each year. Hunting network "2021 first half of the network security report" predicts that in 2027 the demand for cybersecurity talents is 300W, and now there are only 10W people engaged in the network security industry.

There is a lot of room for growth in the industry and very many positions

Since the network security industry industry, then dozens of new network security industry positions: network security experts, network security analysts, security consultants, network security engineers, security architects, security operations and maintenance engineers, penetration engineers, information security administrators, data security engineers, network security operations engineers, network security emergency response engineers, data appraisal division, network security product managers Network Security Service Engineer, Network Security Trainer, Network Security Auditor, Threat Intelligence Analysis Engineer, Disaster Recovery Professional, Practical Attack and Defense Professional...

High potential for career advancement

The cybersecurity program is highly technical in nature, and in particular, mastery of the core network architectures and security technologies at work provides an irreplaceable competitive advantage in career advancement.

With the continuous improvement of personal ability, the professional value of the work engaged in will also be with their own experience and the maturity of the project operation, the appreciation space all the way up, which is also the main reason why it is welcomed by everyone.

In a way, in the field of cybersecurity, as in the case of doctors, the older you get, the better you get, because the more mature your skills become, the more your work is valued, and the more you get promoted, the more you get paid.

as ifresoluteyousurname Yemiss (feel wistful about the absence of sb. or sth)sciencepractice:Hacking& Cybersecurity

Today as long as you give my post a like, my private collection of net security study materials as free to share with you, to see what are the things.

Pick it up here:

I spent days and nights organizing this.The latest and most complete net security study kitShared with you for free, it contains the following stuff:

1. Study routes & career planning

在这里插入图片描述
在这里插入图片描述

2. A full set of system lessons & Beginner to Mastery

在这里插入图片描述

3. Hacking eBooks & Interview Materials

在这里插入图片描述

4. Vulnerability mining tools and learning documents

在这里插入图片描述

All of these things are free for the taking!Hacker's Latest Bundle