我正在使用websitepanel并在Web Sites ==> Extensions选项卡中,ASP.NET版本是4个集成管道.
我的问题是,如何才能找出我的服务器现在使用的点网核的版本?
我真的不知道asp.net是4还是dot网核也不是4.
如果它是版本4,那么它是否意味着安装了版本2?
因为在扩展选项卡中,我有四个选项:2,2个集成管道,4个和4个集成管道.
提前致谢
我有一个包含一些 IP 的纯文本文件,如下所示:
194.225.0.0 - 194.225.15.255
194.225.24.0 - 194.225.31.255
62.193.0.0 - 62.193.31.255
195.146.53.128 - 195.146.53.225
217.218.0.0 - 217.219.255.255
195.146.40.0 - 195.146.40.255
85.185.240.128 - 85.185.240.159
78.39.194.0 - 78.39.194.255
78.39.193.192 - 78.39.193.207
Run Code Online (Sandbox Code Playgroud)
我想按 IP 地址对文件进行排序。我的意思是只有第一部分很重要。
我用谷歌搜索并找到了一些程序,但我想知道是否可以通过 Powershell 而不使用其他应用程序实现这一点。
我有一个像这样的 Linux 方式,但无法在 Windows 中达到它:
sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 file
Run Code Online (Sandbox Code Playgroud)
更新1
@TheMadTechnician,这是我运行你的命令时的输出:
85.185.240.128 - 85.185.240.159
195.146.40.0 - 195.146.40.255
78.39.193.192 - 78.39.193.207
78.39.194.0 - 78.39.194.255
217.218.0.0 - 217.219.255.255
194.225.24.0 - 194.225.31.255
194.225.0.0 - 194.225.15.255
195.146.53.128 - 195.146.53.225 …Run Code Online (Sandbox Code Playgroud) 我有VPS与Ubuntu 18.04 LTS用Mongodb我的剧本工作,直到4天前很好,但突然我的托管服务器被重新启动(我购买它从一个托管公司),当我的服务器再次被启动,我看到我的网站不能正常工作,并没有连接到数据库。结果systemctl status mongod是:
mongod.service - MongoDB Database Server
Loaded: loaded (/lib/systemd/system/mongod.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Thu 2020-10-29 22:47:35 +0330; 17h ago
Docs: https://docs.mongodb.org/manual
Process: 2800 ExecStart=/usr/bin/mongod --config /etc/mongod.conf (code=exited, status=14)
Main PID: 2800 (code=exited, status=14)
Oct 29 22:47:35 MYHOSTNAME systemd[1]: Started MongoDB Database Server.
Oct 29 22:47:35 MYHOSTNAME systemd[1]: mongod.service: Main process exited, code=exited, status=14/n/a
Oct 29 22:47:35 MYHOSTNAME systemd[1]: mongod.service: Failed with result 'exit-code'.
Run Code Online (Sandbox Code Playgroud)
当我重新启动服务时,没有任何反应。我查了一下/var/log/mongodb/mongod.log …
这是示例数据:
ServerA
Value1 fh824rfz
Plan CustomA
ServerB
Value3 9fgjzxlo
Plan CustomD
ServerC
Value10 339fgh0l
Plan CustomE
Run Code Online (Sandbox Code Playgroud)
这是正则表达式的工作原理vscode:
(Value[0-9]{1,2} [0-9a-z]{8}\n)(.*)
Run Code Online (Sandbox Code Playgroud)
预期输出:
ServerA
Value1 fh824rfz
ServerB
Value3 9fgjzxlo
ServerC
Value10 339fgh0l
Run Code Online (Sandbox Code Playgroud)
但我正在尝试使用sed这样的正则表达式,但它们不起作用:
-E 's|(Value[0-9]{1,2} [0-9a-z]{8}\n)(.*)\n|\1|g'
-re 's|(Value[0-9]{1,2} [0-9a-z]{8}\n)(.*)\n|\1|g'
-zre 's|(Value[0-9]{1,2} [0-9a-z]{8}\n)(.*)\n|\1|g'
Run Code Online (Sandbox Code Playgroud)
我怎样才能做到这一点?我认为问题在于\n,因为当我删除它时,示例可以工作(但仍然不是预期的输出)。
$date这是一个日志文件(分隔符是空格,日期格式由不带参数的命令写入):
Client1 purchased at Wed Jun 14 10:15:10 +0430 2023
Client2 returned at Wed Jun 14 16:15:10 +0430 2023
Client3 purchased at Sat Jul 8 16:04:31 +0330 2023
Client3 returned (returned all) at Sat Jul 8 20:05:11 +0330 2023
Client4 returned at Sat Jul 8 21:15:19 +0330 2023
Run Code Online (Sandbox Code Playgroud)
7月8日之后,我添加了a(here all)但不是所有的heres。事实上,(here all)仅在一天中的特定时间添加一次(假设 16)。
所以,我的预期输出和逻辑:
if second column is purchased and it happened during this hour (for example if current hour is 11, it should …Run Code Online (Sandbox Code Playgroud) 这是示例文件:
someText here some other columns (exist but I don't intend to read them)
anotherText there some other columns (exist but I don't intend to read them)
YouAreGood here some other columns (exist but I don't intend to read them)
HeIsNormal there some other columns (exist but I don't intend to read them)
Run Code Online (Sandbox Code Playgroud)
我想检查第二列是否为here,然后执行某些操作。
这是我的尝试,我不确定如何正确:
#!/usr/bin/bash
awk '{print $2}' sample | while read -r line
do
if [ "$line" == 'here' ]
then
echo "$line"
fi
done
Run Code Online (Sandbox Code Playgroud)
第二个文件中的预期输出: …
我有一个名为error_logapache 的文件,我想使用sed命令查看该文件的第一行和最后一行。您能帮我一下吗?我该怎么做?
我知道如何使用head和tail命令来做到这一点,但我很好奇是否也可以在sed命令中实现。
我已经阅读man sed并用谷歌搜索了很多,但不幸的是什么也没找到。
bash ×3
awk ×2
sed ×2
.net-core ×1
asp.net ×1
asp.net-core ×1
ip-address ×1
mongodb ×1
powershell ×1
regex ×1
sorting ×1