Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use linux's sh command shell command language interpreter

2025-04-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly introduces the use of linux sh command shell command language interpreter, the article is very detailed, has a certain reference value, interested friends must read it!

The sh command is a shell command language interpreter that executes commands to read from standard input or from a file. Through the user input commands, and the kernel to communicate!

Bourne Again Shell (bash) is a Shell developed by the Free Software Foundation (GNU), which is a default Shell in Linux systems. Bash is not only compatible with Bourne Shell, but also inherits the advantages of C Shell, Korn Shell and so on.

Syntax format: sh [parameters]

Common parameters:

Reference example

Trace script debug shell script, can print out each line of command executed and the current status:

[root@linuxcool] # sh-x test.sh + DEFINE=30 + cat / var/log/secure + awk'/ Failed/ {+ + ip [$(NF-3)]} END {for (i in ip) print I "=" ip [I]}'+ + cat / root/satools/black.txt + for i in '`cat / root/satools/b lack.txt`' + + echo 121.42.0.16 + 1427 + + awk-F ='{print $1}'+ IP=121.42.0.16 + + echo 121.42.0. 1601427 + + awk-F ='{print $2}'+ NUM=1427 +'['1427-gt 30']'+ grep 121.42.0.16 / etc/hosts.deny +'[1-gt 0']'+ echo sshd:121.42.0.16 + echo vsftpd:121.42.0.16 + for i in '`cat / root/satools/b lack.txt`' + + echo 121.42.0.72276 + + awk-F ='{print $1}'+ IP=121.42.0.72 + + awk-F ='{print $1}' Print $2}'+ + echo 121.42.0.72276 + NUM=276 +'['276-gt 30']'+ grep 121.42.0.72 / etc/hosts.deny +'[1-gt 0']'+ echo sshd:121.42.0.72 + echo vsftpd:121.42.0.72 is all the contents of the shell command language interpreter using linux's sh command Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report