Tutorial: Several of the most commonly used commands in Linux, including viewing the current system, etc.

888u

Last update at :2024-06-04,Edit by888u

Tutorials : Several of the most commonly used commands in Linux, including viewing the current system, etc.

1.Linux check the current system: cat /etc/issue

With one simple command, you can immediately know whether it is centos, ubuntu, or debian.

cat /etc/issue

2.A brief analysis of the usage of VI commands under Linux

Under the Linux command line, files such as php or conf can be modified using vi software. There is no need to download them locally every time and upload them after modification.

vi /etc/ssh/sshd_config #Modify sshd_config file command After vi a file, press i again, insert will be displayed in the lower left corner, and then the file can be modified. After modification, press esc and the insert in the lower left corner will disappear. Then enter: and the : will appear in the lower left corner. Then enter x and press Enter to save and exit.

3. The top command can view the system status in real time:

The key area to focus on is the load average in the first row, which is the system load, that is, the entire VPS resource usage. If the website is built normally, it rarely exceeds 5. If the BURST exceeds 20, the account will be banned. The first one in the third row is the resource occupied by the CPU. There is also the following ??%wa, which is the status of the hard disk. Under normal circumstances, it is best not to occupy more than 30% of the CPU. If the wa index is above 30% for a long time, the hard disk is basically in a weak state. The fourth row is memory, how much is the total, how much is used, and how much is left.

4.wget command downloads network files, for example:

wget http://cachefly.cachefly.net/100mb.test 5.chmod command #The following is the description of this command

chmod +x /home/auto.sh #Give auto.sh executable permissions chmod -R 777 /home/wwwroot # Grant write permission to /home/wwwroot (required when installing some website programs) 6.mv command moves files

mv /home/wwwroot/abc.tar.gz /home/backup # Move abc.tar.gz to the backup directory 7.rm command delete files

rm test.tar.gz # Delete test.tar.gz, you will be prompted to confirm y. rm -rf /home/wwwroot/test # Delete the test directory without prompting. Do not use it indiscriminately. Remember. 8.tar command C packaging and X decompression files

tar zcvf test.tar.gz /home/wwwroot #Package /home/wwwroot tar zxvf tet.tar.gz # Decompress test.tar.gz in the current directory 9. Several other commonly used ones

cd Example: cd /home/wwwroot # Enter a directory ls # View files in the current directory echo nameserver 8.8.8.8 >> /etc/resolv.conf #Set dns to Google's ps -e -o "%C : %p : %z : %a"|sort -k5 -nr ps -e -o "%C : %p : %z : %a"|sort -nr

Recommended site search: Hong Kong server recommendation, foreign domain name, hosting, website space purchase, Western Digital registration, website space registration-free, proxy server IP check IP detailed address http proxy IP, how much does it cost to rent a server for one year,

p>

Tutorial: Several of the most commonly used commands in Linux, including viewing the current system, etc.

All copyrights belong to 888u unless special state
取消
微信二维码
微信二维码
支付宝二维码