Liunx can be divided into Redhat series and debian series, all of which use the same Liunx kernel. The biggest difference is the management of RPM packages, using different software sources.
But compared to the desktop side of the debian series, Redhat has better stability.
So I chose to use the Redhat series of CentOS.

Liunx overall attention

1> Command or content is strictly case sensitive

2> All content is in the form of a file, including hardware

3> No extension distinction, carrying the extension is just to let the user know what the file is.

Remote tool

Server is turned on by default

Command line tool: SecureCRT, putty

File transfer tool (win and liunx): Winscp

Winscp download: https://sourceforge.net/projects/winscp/files/WinSCP/5.13.5/WinSCP-5.13.5-Setup.exe/download

Liunx some important directories and files

/bin binary executable available to all users

/usr/bin A binary executable available to all users, not available in safe mode

/sbin only super administrator can execute

/usr/sbin is only super administrator executable and not available in safe mode

/usr system resource directory

/boot startup resource directory

/dev hardware device file

/etc most configuration files

/home/username user directory

/root superuser’s home directory

/tmp temporary directory

/var log file

/etc/rc.local will automatically enter when booting, you can write the service start standard command, let it boot from

Command shortcut

Tab key command completion

Ctrl+C Forces the current command to stop

Ctrl+L clear screen, clear command

Ctrl+D to exit the current terminal

Ctrl+A Move the cursor to the beginning of the command

Ctrl+E moves the close to the end of the command

Ctrl+U deletes all characters before the cursor

Liunx command introduction and supplement

Clear screen

Clear

View system health status, system process and other details, q key to exit

Top

Shutdown and restart

Added: set time (-h 23:10), (-c) cancel the previous shutdown command, remove -r is the shutdown

Shutdown -r now

Set only ping three times

Ping -c 3 ip address...

View the local IP address, lo is the loopback network card, used for the internal network test of the machine

Ifconfig

Tracking access URL, test failed

Traceroute website URL

CentOS configuration network

Setup

View system bit

File /bin/ ls
or
Getconf LONG_BIT

To view the current system release version, you need to install yum install -y redhat-lsb

Lsb_release -a

View all port descriptions of this machine

Netstat -tlun

View the location of the command

You can see the alias (the command that distinguishes the standard liunx)

Which command...

You can see where the help file is located

Whereis command...

Command help document

View the help documentation for the command, the operation is the same as the file paging

Man command...

View help for built-in commands

Help command...

 Historical use command

View all history commands, including those in the cache

History

Write the history command in the cache to the (~/.bash_history) file. The default maximum is 1000.

History -w

Empty the history command in the cache

History -c

Process management

View process tree

Pstree -pu

View all processes in the system

Ps aux

Kill kills the process, the parameter must be PID, 1 is restart, 9 is forced termination, 15 is normal termination

Kill -15 PID

Killall or pkill kills the process, the parameter is the process name, 1 is the restart, 9 is the forced termination, and 15 is the normal termination.

For example, [killall -1 httpd] or [pkill -1 process name] is to restart the Apache process.

Killall -15 process name

Command put into the background

...command&

Pause the current run and put it in the background (pause)

Ctrl + Z

View a program that is paused

Jobs -l

Let the pause program continue to work

Fg first number

List the process files that are running at the beginning of the string

Lsof -c string

List files opened by a user

Lsof -u username

List files opened by a PID process

Lsof -p PID

Scheduled task (crond service)

Crontab option

The options are -e -l -r

-e editing task


Liunx-Treasure-Chest-Centos-Supplement1

* * * * * command
Note: There must be spaces between every *
The first * is the first few minutes of an hour, [0,59 ]
The second * indicates the first few hours of the day, [0, 23 ]
The third * indicates the day of the month, [0,31 ]
The fourth * indicates the first few months of the year, [1,12 ]
The fifth * indicates the day of the week, [0,7 ], where 0 and 7 both indicate Sunday.
Special symbol:
[ * 】 means any time
[,] comma, indicating discontinuous time, such as the first * inside write 12, 50, 55, **** indicates multiple features per hour
[ -] A minus sign indicates a continuous range. For example, writing a ****0-3 in the fifth * means that it will be executed from Sunday to Wednesday.
[ */10] If it is in minutes, it means every ten minutes.


Liunx-Treasure-Chest-Centos-Supplement2

-l view task

-r deletes all tasks of the current user

 Command rename

View all system definition aliases

Alias

Set the command alias, when the login is valid

> Command priority: absolute / relative path -> alias -> command itself (bash)

> (vim ~/.bashrc) change the environment variable in the system file, permanently valid alias

Alias ​​a= " ls "

Delete command alias

Unalias alias...

Communication


send email:

Mail a user name carriage return title ctrl+D OK to send


Check Mail:

Command: mail

View: Select serial number

Delete: d serial number

Exit: q


Specified user to send

Write An online user name carriage return content ctrl+D determines to send


Send to all users

Wall content....